运行heroku时Heroku'应用程序错误'

时间:2014-09-09 22:20:09

标签: ruby-on-rails ruby heroku

我正在尝试在heroku上运行我的rails应用程序。我在执行资产后已成功部署:预编译以解决由引导程序引起的一些问题。我也做了一个heroku run rake db:migrate。打开我的应用程序时,我收到应用程序错误,特别是状态= 503和错误= H10。

这是我的heroku日志

2014-09-09T22:04:45.055585+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:49:in `new_from_string'
2014-09-09T22:04:45.055589+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/server.rb:277:in `build_app_and_options_from_config'
2014-09-09T22:04:45.055592+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/server.rb:199:in `app'
2014-09-09T22:04:45.055596+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/server.rb:314:in `wrapped_app'
2014-09-09T22:04:45.055593+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.1.4/lib/rails/commands/server.rb:50:in `app'
2014-09-09T22:04:45.055602+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.1.4/lib/rails/commands/server.rb:69:in `start'
2014-09-09T22:04:45.055599+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/server.rb:250:in `start'
2014-09-09T22:04:45.055603+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.1.4/lib/rails/commands/commands_tasks.rb:81:in `block in server'
2014-09-09T22:04:45.055610+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.1.4/lib/rails/commands/commands_tasks.rb:40:in `run_command!'
2014-09-09T22:04:45.055606+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.1.4/lib/rails/commands/commands_tasks.rb:76:in `tap'
2014-09-09T22:04:45.055609+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.1.4/lib/rails/commands/commands_tasks.rb:76:in `server'
2014-09-09T22:04:45.055613+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.1.4/lib/rails/commands.rb:17:in `<top (requi
red)>'
2014-09-09T22:04:45.055615+00:00 app[web.1]:    from bin/rails:8:in `require'
2014-09-09T22:04:45.055618+00:00 app[web.1]:    from bin/rails:8:in `<main>'
2014-09-09T22:04:45.086736+00:00 app[web.1]: => Booting WEBrick
2014-09-09T22:04:45.749149+00:00 heroku[web.1]: Process exited with status 1
2014-09-09T22:04:45.757909+00:00 heroku[web.1]: State changed from starting to crashed
2014-09-09T22:04:45.758283+00:00 heroku[web.1]: State changed from crashed to starting
2014-09-09T22:04:48.723392+00:00 heroku[web.1]: Starting process with command `bin/rails server -p 40097 -e production`
2014-09-09T22:04:51.723638+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.1.4/lib/rails/engine.rb:468:in `block (2 levels) in eager_load!'
2014-09-09T22:04:51.723658+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.1.4/lib/rails/initializable.rb:55:in `block in run_initializers'
2014-09-09T22:04:51.723676+00:00 app[web.1]:    from /app/config/environment.rb:5:in `<top (required)>'
2014-09-09T22:04:51.723790+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:49:in `eval'
2014-09-09T22:04:51.723805+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.1.4/lib/rails/commands/commands_tasks.rb:76:in `tap'
2014-09-09T22:04:51.755978+00:00 app[web.1]: => Ctrl-C to shutdown server
2014-09-09T22:04:51.723636+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:225:in `require_dependency'
2014-09-09T22:04:51.723656+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.1.4/lib/rails/initializable.rb:30:in `run'
2014-09-09T22:04:51.723675+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.1.4/lib/rails/application.rb:300:in `initialize!'
2014-09-09T22:04:51.723789+00:00 app[web.1]:    from /app/config.ru:in `<main>'
2014-09-09T22:04:51.723803+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.1.4/lib/rails/commands/commands_tasks.rb:81:in `block in server'
2014-09-09T22:04:51.723621+00:00 app[web.1]: class users::allController < Devise::allController
2014-09-09T22:04:51.723643+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.1.4/lib/rails/engine.rb:467:in `block in eager_load!'
2014-09-09T22:04:51.723661+00:00 app[web.1]:    from /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/tsort.rb:183:in `block (2 levels) in each_strongly_connected_component'
2014-09-09T22:04:51.723681+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:247:in `block in require'
2014-09-09T22:04:51.723793+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:40:in `parse_file'
2014-09-09T22:04:51.755972+00:00 app[web.1]: => Rails 4.1.4 application starting in production on http://0.0.0.0:40097
2014-09-09T22:04:51.755980+00:00 app[web.1]: Exiting
2014-09-09T22:04:51.723600+00:00 app[web.1]: /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:247:in `require': /app/app/controllers/users/all_controller.rb:1: class/module name must be CONSTANT (SyntaxError)
2014-09-09T22:04:51.723639+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.1.4/lib/rails/engine.rb:467:in `each'
2014-09-09T22:04:51.723660+00:00 app[web.1]:    from /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/tsort.rb:150:in `block in tsort_each'
2014-09-09T22:04:51.723679+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:247:in `require'
2014-09-09T22:04:51.723792+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:49:in `new_from_string'
2014-09-09T22:04:51.723806+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.1.4/lib/rails/commands/commands_tasks.rb:76:in `server'
2014-09-09T22:04:51.755974+00:00 app[web.1]: => Run `rails server -h` for more startup options
2014-09-09T22:04:51.723626+00:00 app[web.1]:                             ^
2014-09-09T22:04:51.723645+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.1.4/lib/rails/engine.rb:465:in `each'
2014-09-09T22:04:51.723662+00:00 app[web.1]:    from /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/tsort.rb:219:in `each_strongly_connected_component_from'
2014-09-09T22:04:51.723684+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:232:in `load_dependency'
2014-09-09T22:04:51.723795+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/server.rb:277:in `build_app_and_options_from_config'
2014-09-09T22:04:51.723808+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.1.4/lib/rails/commands/commands_tasks.rb:40:in `run_command!'
2014-09-09T22:04:51.723631+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:247:in `require'
2014-09-09T22:04:51.723650+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.1.4/lib/rails/application/finisher.rb:58:in `each'
2014-09-09T22:04:51.723669+00:00 app[web.1]:    from /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/tsort.rb:180:in `each_strongly_connected_component'
2014-09-09T22:04:51.723784+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:55:in `instance_eval'
2014-09-09T22:04:51.723799+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/server.rb:314:in `wrapped_app'
2014-09-09T22:04:51.723633+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:348:in `require_or_load'
2014-09-09T22:04:51.723651+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.1.4/lib/rai
ls/application/finisher.rb:58:in `block in <module:Finisher>'
2014-09-09T22:04:51.723670+00:00 app[web.1]:    from /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/tsort.rb:148:in `tsort_each'
2014-09-09T22:04:51.723786+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:55:in `initialize'
2014-09-09T22:04:51.723800+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/server.rb:250:in `start'
2014-09-09T22:04:51.755966+00:00 app[web.1]: => Booting WEBrick
2014-09-09T22:04:51.723630+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:232:in `load_dependency'
2014-09-09T22:04:51.723648+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.1.4/lib/rails/engine.rb:346:in `eager_load!'
2014-09-09T22:04:51.723667+00:00 app[web.1]:    from /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/tsort.rb:180:in `each'
2014-09-09T22:04:51.723783+00:00 app[web.1]:    from /app/config.ru:3:in `block in <main>'
2014-09-09T22:04:51.723798+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.1.4/lib/rails/commands/server.rb:50:in `app'
2014-09-09T22:04:51.723810+00:00 app[web.1]:    from bin/rails:8:in `require'
2014-09-09T22:04:51.723628+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:247:in `block in require'
2014-09-09T22:04:51.723647+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.1.4/lib/rails/engine.rb:465:in `eager_load!'
2014-09-09T22:04:51.723666+00:00 app[web.1]:    from /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/tsort.rb:182:in `block in each_strongly_connected_component'
2014-09-09T22:04:51.723686+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:247:in `require'
2014-09-09T22:04:51.723796+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/server.rb:199:in `app'
2014-09-09T22:04:51.723809+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.1.4/lib/rails/commands.rb:17:in `<top (required)>'
2014-09-09T22:04:51.723635+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:307:in `depend_on'
2014-09-09T22:04:51.723652+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.1.4/lib/rails/initializable.rb:30:in `instance_exec'
2014-09-09T22:04:51.723674+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.1.4/lib/rails/initializable.rb:54:in `run_initializers'
2014-09-09T22:04:51.723787+00:00 app[web.1]:    from /app/config.ru:in `new'
2014-09-09T22:04:51.723802+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.1.4/lib/rails/commands/server.rb:69:in `start'
2014-09-09T22:04:51.723812+00:00 app[web.1]:    from bin/rails:8:in `<main>'
2014-09-09T22:04:51.755976+00:00 app[web.1]: => Notice: server is listening on all interfaces (0.0.0.0). Consider using 127.0.0.1 (--binding option)
2014-09-09T22:04:52.493206+00:00 heroku[web.1]: Process exited with status 1
2014-09-09T22:04:52.502892+00:00 heroku[web.1]: State changed from starting to crashed
2014-09-09T22:04:53.571153+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=powerful-scrubland-9818.herokuapp.com request_id=4999439e-9786-4555-a57a-933d885c2f1e fwd="54.82.145.140" dyno= connect= service= status=503 bytes=
2014-09-09T22:04:56.844339+00:00 heroku[api]: Starting process with command `bundle exec rake db:migrate` by alfonsopintos@gmail.com
2014-09-09T22:05:00.487482+00:00 heroku[run.1716]: Starting process with command `bundle exec rake db:migrate`
2014-09-09T22:05:00.448479+00:00 heroku[run.1716]: Awaiting client
2014-09-09T22:05:00.719502+00:00 heroku[run.1716]: State changed from starting to up
2014-09-09T22:05:04.780344+00:00 heroku[run.1716]: State changed from up to complete
2014-09-09T22:05:04.764625+00:00 heroku[run.1716]: Process exited with status 0
2014-09-09T22:05:09.700119+00:00 heroku[api]: Starting process with command `bundle exec rake db:migrate` by alfonsopintos@gmail.com
2014-09-09T22:05:13.261146+00:00 heroku[run.3019]: Starting process with command `bundle exec rake db:migrate`
2014-09-09T22:05:13.186468+00:00 heroku[run.3019]: Awaiting client
2014-09-09T22:05:13.583931+00:00 heroku[run.3019]: State changed from starting to up
2014-09-09T22:05:18.478766+00:00 heroku[run.3019]: Process exited with status 0
2014-09-09T22:05:18.497817+00:00 heroku[run.3019]: State changed from up to complete
2014-09-09T22:05:24.001387+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=powerful-scrubland-9818.herokuapp.com request_id=51427254-23d8-45b1-84ef-6d2327163829 fwd="50.206.104.35" dyno= connect= service= status=503 bytes=
2014-09-09T22:05:24.284415+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=powerful-scrubland-9818.herokuapp.com request_id=831be281-88d5-4d09-ba7c-034e163dd63b fwd="50.206.104.35" dyno= connect= service= status=503 bytes=
2014-09-09T22:05:25.591676+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=powerful-scrubland-9818.herokuapp.com request_id=e74f87d6-fe73-4b28-b63d-46c0d8c91dab fwd="50.206.104.35" dyno= connect= service= status=503 bytes=
2014-09-09T22:05:25.799197+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=powerful-scrubland-9818.herokuapp.com request_id=91257b4c-045e-4e59-a91c-e09a97cf5edb fwd="50.206.104.35" dyno= connect= service= status=503 bytes=
2014-09-09T22:05:53.416437+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=powerful-scrubland-9818.herokuapp.com request_id=a638a16c-4dd9-425e-9175-572845ac7732 fwd="50.206.104.35" dyno= connect= service= status=503 bytes=
2014-09-09T22:05:53.799400+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=powerful-scrubland-9818.herokuapp.com request_id=830cefb2-970f-4709-9c39-357bd03a60c7 fwd="50.206.104.35" dyno= connect= service= status=503 bytes=

编辑:这是确切的语法错误。它是一个设计控制器。自安装设备以来,它没有被改变。

2014-09-09T22:29:25.827490+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:307:in `depend_on'
2014-09-09T22:29:25.827493+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.1.4/lib/rails/engine.rb:468:in `block (2 levels) in eager_load!'
2014-09-09T22:29:25.827503+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.1.4/lib/rails/engine.rb:346:in `eager_load!'
2014-09-09T22:29:25.827505+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.1.4/lib/rails/application/finisher.rb:58:in `each'
2014-09-09T22:29:25.827456+00:00 app[web.1]: /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:247:in `require': /app/app/controllers/users/all_controller.rb:1: class/module name must be CONSTANT (SyntaxError)
2014-09-09T22:29:25.827480+00:00 app[web.1]: class users::allController < Devise::allController
2014-09-09T22:29:25.827482+00:00 app[web.1]:                             ^
2014-09-09T22:29:25.827499+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.1.4/lib/rails/engine.rb:467:in `block in eager_load!'
2014-09-09T22:29:25.827497+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.1.4/lib/rails/engine.rb:467:in `each'
2014-09-09T22:29:25.827502+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.1.4/lib/rails/engine.rb:465:in `eager_load!'
2014-09-09T22:29:25.827528+00:00 app[web.1]:    from /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/tsort.rb:148:in `tsort_each'

2 个答案:

答案 0 :(得分:1)

在尝试加载控制器时,看起来问题可能出在其中一个控制器上

app/controllers/users/all_controller.rb:1: class/module name must be CONSTANT (SyntaxError)

我把它从日志中删除了,如果你发布了一些代码,可能会有所帮助,但首先要检查一下

答案 1 :(得分:1)

<强>命名

确实,错误似乎是这样的:

/app/app/controllers/users/all_controller.rb:1: class/module name must be CONSTANT (SyntaxError)
class users::allController < Devise::allController

问题是您需要使用Constant名称来定义/调用控制器。目前,你没有这样做。

简单地说,您需要执行以下操作:

#app/controllers/users/all_controller.rb
class Users::AllController < Devise::AllController

这很重要,因为Ruby(基于Rails构建)和大多数其他软件框架/语言,通过使用CamelCase调用常量至少;大多数人使用FULL_CAPITALIZATION。

查看您的控制器定义,您正在调用users::allController - 无论是CamelCase还是CAPITALIZED。


<强>设计

你需要考虑的其他事情是Devise的作用。

我从来没有见过设计AllController。我可能错了,但我不认为它有一个。

你正在做的是尝试superclass一个可能不存在的课程。因此,即使你解决了控制器的命名问题,我相信你仍然会遇到真正的类本身。

由于您未向我们展示all_controller的内容,因此我无法向您提供任何进一步的建议。但是,我可以说我相信你会遇到另一个错误,让它保持不变。