2013-02-26 155 views
1

簡單gets.chomp出於某種原因,當我運行:試圖運行在崇高

名= gets.chomp

把名字

我得到的錯誤:

得到: 1:<main>': undefined method格格」的零:NilClass(NoMethodError)

如果刪除了.chomp並運行:

名=得到

把名字

我沒有得到任何提示或錯誤,控制檯只是給了我完成的時間。我究竟做錯了什麼?

通過我用崇高的方式,使用Ruby

+0

可能的重複[試圖在崇高運行一個簡單的gets.chomp](http://stackoverflow.com/questions/15086154/trying-to-run-a-simple-gets-chomp-in -昇華) – knut 2013-06-02 20:55:06

回答