컨솔에 문자 출력하는 ruby 구문은

       print "문자열(스트링)\n"

이다. 여기서 "\n"은 개행을 위해 추가된 개행(newline) 문자이다.
(JRuby의 문자 출력 구문도 위와 같다.)
 
소스 파일명: hello.rb
------------------------------[소스 시작]
print "Hello, world!\n"
------------------------------[소스 끝]

실행> ruby hello.rb
Hello, world!
Posted by Scripter
,