字符串:
puts "hello world"
puts 'hello world'
puts 'I like '+'ruby'
puts 'it\'s my Ruby'
puts 'hello' * 3
PI = 3.1415
puts PI
----------------
结果>ruby hello_ruby2.rb
hello world
hello world
I like ruby
it's my Ruby
hellohellohello
3.1415
>Exit code: 0
# Defining a constant
PI = 3.1416
//常量用大写开头
puts PI
# Defining a local variable
myString = 'I love my city, Pune'
puts myString
=begin
=end
var1 = 5;
var2 = '2'
puts var1 + var2.to_i
# << appending to a string
a = 'hello '
a<<'world.
I love this world...'
puts a
=begin
<script type="text/javascript" id="wumiiRelatedItems"> </script>