Rails S语法错误

时间:2013-09-04 13:53:37

标签: ruby-on-rails-3

将我的应用上传到git& heroku成功,我的应用程序现在不起作用,当我运行localhost:3000无法连接消息 - 。当我做rails s时 - 我现在收到错误信息

=&GT;启动WEBrick =&GT; Rails 3.2.12应用程序从http://0.0.0.0:3000开发开始 =&GT;用-d调用分离 =&GT; Ctrl-C关闭服务器 退出 /usr/local/rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:469:in load': /Users/neilpatel/code/omrails/app/models/user.rb:12: syntax error, unexpected ':' (SyntaxError) has_many :pins, :dependent => : destroy ^ from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:469:in块中的load_file'     来自/usr/local/rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:639:in new_constants_in' from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:468:in load_file'     来自/usr/local/rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:353:in require_or_load' from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:502:in load_missing_constant'     来自/usr/local/rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:192:in block in const_missing' from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:190:in每个'     来自/usr/local/rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:190:in const_missing' from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.12/lib/active_support/inflector/methods.rb:230:in块in co <​​/ p>

1 个答案:

答案 0 :(得分:1)

app/models/user.rb的第12行,而不是:

:dependent => : destroy

你应该这样做:

:dependent => :destroy

在提问之前,请尝试了解错误信息的实际内容。