Ruby on Rails 生成控制器时出现错误
我目前正在尝试使用以下命令在 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
但得到相同的结果,任何人都知道以前一直在工作。
I'm currently trying to generate a controller in rails with the command:
rails generate controller Songs index upload delete
But I get the error:
/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>'
Ive also tried just using:
rails generate
But get the same result, anyone have any idea has previously been working.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
检查 config/application.rb 的第 20 或 21 行是否有未闭合的括号。这就是错误消息所说的内容。
Check line 20 or 21 of your config/application.rb for an unclosed parentheses. That's what the error message says.