将我的应用上传到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: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>
答案 0 :(得分:1)
在app/models/user.rb
的第12行,而不是:
:dependent => : destroy
你应该这样做:
:dependent => :destroy
在提问之前,请尝试了解错误信息的实际内容。