Ruby on rails Heroku启动应用程序错误Ruby on Rails

Ruby on rails Heroku启动应用程序错误Ruby on Rails,ruby-on-rails,ruby,heroku,Ruby On Rails,Ruby,Heroku,正在尝试在Heroku上启动应用程序,但它不断收到应用程序错误。这是heroku日志,请让我知道我能做些什么来让应用程序运行。我们已经实现了pusher,可以让网站在本地主机上运行,甚至可以跨不同的本地主机运行pusher功能,但除此之外,它在heroku上不起作用 2012-11-04T19:57:31+00:00 app[web.1]: Connecting to database specified by DATABASE_URL 2012-11-04T19:57:31+00:00 app

正在尝试在Heroku上启动应用程序,但它不断收到应用程序错误。这是heroku日志,请让我知道我能做些什么来让应用程序运行。我们已经实现了pusher,可以让网站在本地主机上运行,甚至可以跨不同的本地主机运行pusher功能,但除此之外,它在heroku上不起作用

2012-11-04T19:57:31+00:00 app[web.1]: Connecting to database specified by DATABASE_URL
2012-11-04T19:57:31+00:00 app[web.1]: /app/app/controllers/comments_controller.rb:2:in `<class:CommentsController>': undefined method `post' for CommentsController:Class (NoMethodError)
2012-11-04T19:57:31+00:00 app[web.1]:   from /app/app/controllers/comments_controller.rb:1:in `<top (required)>'
2012-11-04T19:57:31+00:00 app[web.1]: Exiting
2012-11-04T19:57:31+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:251:in `require'
2012-11-04T19:57:31+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:236:in `load_dependency'
2012-11-04T19:57:31+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:251:in `block in require'
2012-11-04T19:57:31+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:251:in `require'
2012-11-04T19:57:31+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:359:in `require_or_load'
2012-11-04T19:57:31+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:313:in `depend_on'
2012-11-04T19:57:31+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:225:in `require_dependency'
2012-11-04T19:57:31+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/engine.rb:439:in `block (2 levels) in eager_load!'
2012-11-04T19:57:31+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/engine.rb:438:in `each'
2012-11-04T19:57:31+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/engine.rb:438:in `block in eager_load!'
2012-11-04T19:57:31+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/engine.rb:436:in `each'
2012-11-04T19:57:31+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/engine.rb:436:in `eager_load!'
2012-11-04T19:57:31+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/application/finisher.rb:53:in `block in <module:Finisher>'
2012-11-04T19:57:31+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/initializable.rb:30:in `instance_exec'
2012-11-04T19:57:31+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/initializable.rb:30:in `run'
2012-11-04T19:57:31+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/initializable.rb:55:in `block in run_initializers'
2012-11-04T19:57:31+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/initializable.rb:54:in `run_initializers'
2012-11-04T19:57:31+00:00 app[web.1]:   from /app/config.ru:1:in `<main>'
2012-11-04T19:57:31+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/lib/rack/builder.rb:40:in `eval'
2012-11-04T19:57:31+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/lib/rack/builder.rb:40:in `parse_file'
2012-11-04T19:57:31+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/lib/rack/server.rb:200:in `app'
2012-11-04T19:57:31+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/lib/rack/server.rb:301:in `wrapped_app'
2012-11-04T19:57:31+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/commands/server.rb:46:in `app'
2012-11-04T19:57:31+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/initializable.rb:54:in `each'
2012-11-04T19:57:31+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/application.rb:136:in `initialize!'
2012-11-04T19:57:31+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/lib/rack/server.rb:252:in `start'
2012-11-04T19:57:31+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/commands/server.rb:70:in `start'
2012-11-04T19:57:31+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/railtie/configurable.rb:30:in `method_missing'
2012-11-04T19:57:31+00:00 app[web.1]:   from /app/config/environment.rb:5:in `<top (required)>'
2012-11-04T19:57:31+00:00 app[web.1]:   from /app/config.ru:4:in `require'
2012-11-04T19:57:31+00:00 app[web.1]:   from /app/config.ru:4:in `block in <main>'
2012-11-04T19:57:31+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/lib/rack/builder.rb:51:in `instance_eval'
2012-11-04T19:57:31+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/lib/rack/builder.rb:51:in `initialize'
2012-11-04T19:57:31+00:00 app[web.1]:   from /app/config.ru:1:in `new'
2012-11-04T19:57:31+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/commands.rb:55:in `block in <top (required)>'
2012-11-04T19:57:31+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/commands.rb:50:in `tap'
2012-11-04T19:57:31+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/commands.rb:50:in `<top (required)>'
2012-11-04T19:57:31+00:00 app[web.1]:   from script/rails:6:in `require'
2012-11-04T19:57:31+00:00 app[web.1]:   from script/rails:6:in `<main>'
2012-11-04T19:57:32+00:00 app[web.1]: => Booting WEBrick
2012-11-04T19:57:32+00:00 app[web.1]: => Rails 3.2.8 application starting in production on http://0.0.0.0:46992
2012-11-04T19:57:32+00:00 app[web.1]: => Call with -d to detach
2012-11-04T19:57:32+00:00 app[web.1]: => Ctrl-C to shutdown server
2012-11-04T19:57:32+00:00 app[web.1]: Connecting to database specified by DATABASE_URL
2012-11-04T19:57:32+00:00 app[web.1]: Exiting
2012-11-04T19:57:32+00:00 app[web.1]: /app/app/controllers/comments_controller.rb:2:in `<class:CommentsController>': undefined method `post' for CommentsController:Class (NoMethodError)
2012-11-04T19:57:32+00:00 app[web.1]:   from /app/app/controllers/comments_controller.rb:1:in `<top (required)>'
2012-11-04T19:57:32+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:251:in `require'
2012-11-04T19:57:32+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:251:in `block in require'
2012-11-04T19:57:32+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:236:in `load_dependency'
2012-11-04T19:57:32+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:251:in `require'
2012-11-04T19:57:32+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:359:in `require_or_load'
2012-11-04T19:57:32+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:313:in `depend_on'
2012-11-04T19:57:32+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:225:in `require_dependency'
2012-11-04T19:57:32+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/engine.rb:439:in `block (2 levels) in eager_load!'
2012-11-04T19:57:32+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/engine.rb:438:in `each'
2012-11-04T19:57:32+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/engine.rb:438:in `block in eager_load!'
2012-11-04T19:57:32+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/engine.rb:436:in `each'
2012-11-04T19:57:32+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/engine.rb:436:in `eager_load!'
2012-11-04T19:57:32+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/application/finisher.rb:53:in `block in <module:Finisher>'
2012-11-04T19:57:32+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/initializable.rb:30:in `instance_exec'
2012-11-04T19:57:32+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/initializable.rb:30:in `run'
2012-11-04T19:57:32+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/initializable.rb:55:in `block in run_initializers'
2012-11-04T19:57:32+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/initializable.rb:54:in `each'
2012-11-04T19:57:32+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/initializable.rb:54:in `run_initializers'
2012-11-04T19:57:32+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/application.rb:136:in `initialize!'
2012-11-04T19:57:32+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/railtie/configurable.rb:30:in `method_missing'
2012-11-04T19:57:32+00:00 app[web.1]:   from /app/config/environment.rb:5:in `<top (required)>'
2012-11-04T19:57:32+00:00 app[web.1]:   from /app/config.ru:4:in `require'
2012-11-04T19:57:32+00:00 app[web.1]:   from /app/config.ru:4:in `block in <main>'
2012-11-04T19:57:32+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/lib/rack/builder.rb:51:in `instance_eval'
2012-11-04T19:57:32+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/lib/rack/builder.rb:51:in `initialize'
2012-11-04T19:57:32+00:00 app[web.1]:   from /app/config.ru:1:in `new'
2012-11-04T19:57:32+00:00 app[web.1]:   from /app/config.ru:1:in `<main>'
2012-11-04T19:57:32+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/lib/rack/server.rb:200:in `app'
2012-11-04T19:57:32+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/commands/server.rb:46:in `app'
2012-11-04T19:57:32+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/lib/rack/server.rb:301:in `wrapped_app'
2012-11-04T19:57:32+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/lib/rack/server.rb:252:in `start'
2012-11-04T19:57:32+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/commands/server.rb:70:in `start'
2012-11-04T19:57:32+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/commands.rb:55:in `block in <top (required)>'
2012-11-04T19:57:32+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/commands.rb:50:in `tap'
2012-11-04T19:57:32+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/commands.rb:50:in `<top (required)>'
2012-11-04T19:57:32+00:00 app[web.1]:   from script/rails:6:in `require'
2012-11-04T19:57:32+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/lib/rack/builder.rb:40:in `eval'
2012-11-04T19:57:32+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/lib/rack/builder.rb:40:in `parse_file'
2012-11-04T19:57:32+00:00 app[web.1]:   from script/rails:6:in `<main>'
2012-11-04T19:57:33+00:00 heroku[web.1]: Process exited with status 1
2012-11-04T19:57:33+00:00 heroku[web.1]: State changed from starting to crashed
2012-11-04T19:57:33+00:00 heroku[web.1]: Process exited with status 1
2012-11-04T20:07:27+00:00 heroku[web.1]: State changed from crashed to down
2012-11-04T20:07:27+00:00 heroku[web.1]: State changed from down to starting
2012-11-04T20:07:39+00:00 heroku[web.1]: State changed from starting to crashed
2012-11-04T20:17:44+00:00 heroku[web.1]: State changed from crashed to down
2012-11-04T20:17:44+00:00 heroku[web.1]: State changed from down to starting
2012-11-04T20:17:56+00:00 heroku[web.1]: State changed from starting to crashed
2012-11-04T20:22:51+00:00 heroku[router]: Error H10 (App crashed) -> GET followalong.herokuapp.com/ dyno= queue= wait= service= status=503 bytes=
2012-11-04T20:22:52+00:00 heroku[router]: Error H10 (App crashed) -> GET followalong.herokuapp.com/favicon.ico dyno= queue= wait= service= status=503 bytes=

正如您所提到的,在本地主机上正常工作时不会出现此错误。尝试删除或注释CommentsController调用,并检查是否能够在Heroku上部署应用程序?一旦应用程序运行,您就可以启用并检查导致此错误的真正原因。

有人试图向/comments发送邮件,而您尚未在CommentsController上定义创建方法。如果您实现了该方法呢?到目前为止,您使用Heroku工具箱完成了哪些步骤?这不是传入的请求-加载CommentsController类是个问题。我认为第2行包含一个post呼叫-可能是路线定义放错了位置?app/controllers/comments\u controller.rb的内容是什么?