Hello,
I just wanted to quickly write some Ruby code to see if my hosting
worked. Went onto the main ruby site and copied this block of code:
# Output "I love Ruby"
say = "I love Ruby"
puts say
# Output "I *LOVE* RUBY"
say['love'] = "*love*"
puts say.upcase
# Output "I *love* Ruby"
# five times
5.times { puts say }
When I tried this it failed:
>>> say['love'] = "*love*"
:0:in `Initialize##1': undefined local variable or method `say' for main:Object
(NoMethodError)
I first thought this might have been because the console doesn't
support local variables and have some other problems going on. So I
tried this:
>>> $say['love'] = "*love*"
:0:in `Initialize##11': undefined local variable or method `[]=' for :NilClass (
NoMethodError)
Why isn't this working?
Thanks
Ben
_______________________________________________
Ironruby-core mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/ironruby-core