我正在尝试运行这个简单的程序:
puts " Hello, what's you're name?"
name = gets.chomp
puts 'Hello,'+ '' + name+ '.'
if name =='Chris'
puts 'What a lovely name!'
end
但我不断收到此输出错误:
1.9.3-p392 :003 > ruby exerise72.rb
NameError: undefined local variable or method `exerise72' for main:Object
from (irb):3
from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.12/lib/rails/commands/console.rb:47:in `start'
from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.12/lib/rails/commands/console.rb:8:in `start'
from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.12/lib/rails/commands.rb:41:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
我不明白出了什么问题。