Ruby on Rails生成控制器,给出错误

时间:2011-04-28 02:44:37

标签: ruby-on-rails ruby rails-generate

我正在尝试使用以下命令在rails中生成控制器:

rails generate controller Songs index upload delete

但我收到错误:

/Users/lucasdobbins/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.5/lib/rails/commands.rb:15:in `require': /Users/lucasdobbins/rails_projects/mp3app/config/application.rb:20: syntax error, unexpected tSYMBEG, expecting ')' (SyntaxError)
      :secret_access_key  => 'fmbDA3...
       ^
/Users/lucasdobbins/rails_projects/mp3app/config/application.rb:21: syntax error, unexpected ')', expecting keyword_end
from /Users/lucasdobbins/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.5/lib/rails/commands.rb:15:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'

我也尝试过使用:

rails generate 

但是得到相同的结果,任何人都有任何想法以前一直在工作。

1 个答案:

答案 0 :(得分:2)

检查config / application.rb的第20行或第21行是否有未闭合的括号。这就是错误信息所说的内容。