阅读 Michael Hartl 的 Ruby on Rails 教程并在第 2.3.3 节遇到问题
“我们首先在命令行使用 rails console 调用控制台,然后使用 User.first 从数据库中检索第一个用户(将结果放入变量 first_user):7”
任何帮助将不胜感激
$ rails console
Loading development environment (Rails 3.2.13)
1.9.3-p429 :001 > >> first_user = User.first
SyntaxError: (irb):1: syntax error, unexpected tRSHFT
>> first_user = User.first
^
from /Users/MattPerloe/.rvm/gems/ruby-1.9.3-p429@rails3tutorial2ndEd/gems/railties-3.2.13/lib/rails/commands/console.rb:47:in `start'
from /Users/MattPerloe/.rvm/gems/ruby-1.9.3-p429@rails3tutorial2ndEd/gems/railties-3.2.13/lib/rails/commands/console.rb:8:in `start'
from /Users/MattPerloe/.rvm/gems/ruby-1.9.3-p429@rails3tutorial2ndEd/gems/railties-3.2.13/lib/rails/commands.rb:41:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'