-2

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

=> 启动 WEBrick => Rails 3.2.12 应用程序开始在开发中http://0.0.0.0:3000 => 使用 -d 调用以分离 => 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:inblock in load_file' from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.12/lib/ active_support/dependencies.rb:639:in load_file'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来自 /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:inload_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:ineach' 来自 /usr/local/rvm/gems/ruby -1.9.3-p392/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:190: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在合作区

4

1 回答 1

1

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

:dependent => : destroy

你应该做:

:dependent => :destroy

在提出问题之前,请尝试了解错误消息的实际含义。

于 2013-09-04T13:58:29.307 回答