Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialROBERT LABUDA
13,901 PointsRuby error: undefined local variable
I'm receiving this message from terminal:
$ ruby hello.rb
hello.rb:1:in <main>': undefined local variable or method
world”' for main:Object (NameError)
I have textmate setup properly with shell scripting support installed. I'm wondering if the clash is with RVM and RBENV. I recall reading somewhere in the RBENV doc that having RVM would disrupt it. Any ideas? Thanks in advance!
Product Team
6,835 PointsRobert, do you know how you fixed this? I am getting the same message.
2 Answers
ROBERT LABUDA
13,901 Points$ruby hello.rb
It is the basic puts "Hello World" program.
Error message:
hello.rb:1:in <main>': undefined local variable or methodworld”' for main:Object (NameError)
Jack Choi
11,420 PointsDoes running the same line in irb work?
$ irb
> puts "Hello World"
ROBERT LABUDA
13,901 Pointsyes it does.
ROBERT LABUDA
13,901 PointsI'm not sure what happened, but everything is now working.
Maciej Czuchnowski
36,441 PointsMaciej Czuchnowski
36,441 PointsCan you show the code that you are trying to run?