Ruby on Rails 生成控制器时出现错误

发布于 2024-11-03 21:54:49 字数 848 浏览 3 评论 0原文

我目前正在尝试使用以下命令在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

您的好友蓝忘机已上羡 2024-11-10 21:54:49

检查 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文