ruby-on-rails - 站点在本地主机上运行正常但在 Heroku 上运行错误

标签 ruby-on-rails postgresql heroku

我不明白这是怎么回事。

我在 postgresql 数据库上使用 ruby​​ on rails 构建了我的网站。

而且它在本地服务器上完美运行。

但是我刚刚将它部署到 Heroku,但我收到了这个错误;

仅供引用,我按照 Heroku 网站上的建议创建了一个 procfile。

Application Error

An error occurred in the application and your page could not be served. Please try again in a few moments.

If you are the application owner, check your logs for details.

   2013-06-26T03:02:07.421697+00:00 app[web.1]:     from /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/commands.rb:50:in `tap'
    2013-06-26T03:02:07.421506+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/handler.rb:20:in `get'
    2013-06-26T03:02:07.421506+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency'
    2013-06-26T03:02:07.421697+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/commands.rb:50:in `<top (required)>'
    2013-06-26T03:02:07.421506+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/handler/thin.rb:1:in `<top (required)>'
    2013-06-26T03:02:07.421506+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/handler.rb:20:in `inject'
    2013-06-26T03:02:07.421697+00:00 app[web.1]:    from script/rails:6:in `require'
    2013-06-26T03:02:07.421697+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/commands.rb:55:in `block in <top (required)>'
    2013-06-26T03:02:07.421697+00:00 app[web.1]:    from script/rails:6:in `<main>'
    2013-06-26T03:02:07.421697+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/server.rb:272:in `server'
    2013-06-26T03:02:07.439117+00:00 app[web.1]: Exiting
    2013-06-26T03:02:07.421506+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/handler.rb:20:in `block in get'
    2013-06-26T03:02:07.421697+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/commands/server.rb:59:in `start'
    2013-06-26T03:02:08.750717+00:00 heroku[web.1]: Process exited with status 1
    2013-06-26T03:02:08.745131+00:00 heroku[web.1]: State changed from starting to crashed
    2013-06-26T03:12:15.338756+00:00 heroku[web.1]: Starting process with command `bundle exec rails server thin -p 47851 -e $RACK_ENV`
    2013-06-26T03:12:21.836547+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/commands.rb:55:in `block in <top (required)>'
    2013-06-26T03:12:21.836547+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/commands/server.rb:59:in `start'
    2013-06-26T03:12:21.836349+00:00 app[web.1]: /app/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require': cannot load such file -- thin (LoadError)
    2013-06-26T03:12:21.836349+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/handler.rb:20:in `get'
    2013-06-26T03:12:21.836349+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `block in require'
    2013-06-26T03:12:21.836349+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/handler.rb:20:in `each'
    2013-06-26T03:12:21.836349+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/handler.rb:20:in `const_get'
    2013-06-26T03:12:21.836349+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/handler/thin.rb:1:in `<top (required)>'
    2013-06-26T03:12:21.836547+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/server.rb:272:in `server'
    2013-06-26T03:12:21.836349+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency'
    2013-06-26T03:12:21.836349+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/handler.rb:20:in `inject'
    2013-06-26T03:12:21.836547+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/commands.rb:50:in `<top (required)>'
    2013-06-26T03:12:21.836349+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
    2013-06-26T03:12:21.836547+00:00 app[web.1]:    from script/rails:6:in `require'
    2013-06-26T03:12:21.836349+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/handler.rb:20:in `block in get'
    2013-06-26T03:12:21.836547+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/commands.rb:50:in `tap'
    2013-06-26T03:12:21.836547+00:00 app[web.1]:    from script/rails:6:in `<main>'
    2013-06-26T03:12:21.865436+00:00 app[web.1]: Exiting
    2013-06-26T03:12:23.663577+00:00 heroku[web.1]: Process exited with status 1
    2013-06-26T03:12:23.677322+00:00 heroku[web.1]: State changed from starting to crashed
    2013-06-26T03:22:43.460462+00:00 heroku[web.1]: State changed from crashed to starting
    2013-06-26T03:22:48.976685+00:00 heroku[web.1]: Starting process with command `bundle exec rails server thin -p 30463 -e $RACK_ENV`
    2013-06-26T03:22:54.590985+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/handler.rb:20:in `each'
    2013-06-26T03:22:54.591157+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/commands.rb:50:in `<top (required)>'
    2013-06-26T03:22:54.590985+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/handler.rb:20:in `block in get'
    2013-06-26T03:22:54.590985+00:00 app[web.1]: /app/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require': cannot load such file -- thin (LoadError)
    2013-06-26T03:22:54.590985+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `block in require'
    2013-06-26T03:22:54.590985+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/handler.rb:20:in `const_get'
    2013-06-26T03:22:54.591157+00:00 app[web.1]:    from script/rails:6:in `<main>'
    2013-06-26T03:22:54.590985+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/handler.rb:20:in `get'
    2013-06-26T03:22:54.591157+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/server.rb:272:in `server'
    2013-06-26T03:22:54.591157+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/commands.rb:55:in `block in <top (required)>'
    2013-06-26T03:22:54.590985+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency'
    2013-06-26T03:22:54.590985+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
    2013-06-26T03:22:54.590985+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/handler/thin.rb:1:in `<top (required)>'
    2013-06-26T03:22:54.590985+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/handler.rb:20:in `inject'
    2013-06-26T03:22:54.591157+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/commands.rb:50:in `tap'
    2013-06-26T03:22:54.591157+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/commands/server.rb:59:in `start'
    2013-06-26T03:22:54.591157+00:00 app[web.1]:    from script/rails:6:in `require'
    2013-06-26T03:22:54.621142+00:00 app[web.1]: Exiting
    2013-06-26T03:22:55.841091+00:00 heroku[web.1]: Process exited with status 1
    2013-06-26T03:22:55.859629+00:00 heroku[web.1]: State changed from starting to crashed
    2013-06-26T03:32:48.892316+00:00 heroku[web.1]: State changed from crashed to starting
    2013-06-26T03:32:52.032180+00:00 heroku[web.1]: Starting process with command `bundle exec rails server thin -p 58591 -e $RACK_ENV`
    2013-06-26T03:32:54.409527+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `block in require'
    2013-06-26T03:32:54.409527+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/handler.rb:20:in `const_get'
    2013-06-26T03:32:54.409527+00:00 app[web.1]: /app/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require': cannot load such file -- thin (Load
    Error)
    2013-06-26T03:32:54.409527+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency'
    2013-06-26T03:32:54.409527+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
    2013-06-26T03:32:54.409527+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/handler.rb:20:in `inject'
    2013-06-26T03:32:54.409527+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/handler/thin.rb:1:in `<top (required)>'
    2013-06-26T03:32:54.409527+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/handler.rb:20:in `block in get'
    2013-06-26T03:32:54.409527+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/handler.rb:20:in `each'
    2013-06-26T03:32:54.409527+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/handler.rb:20:in `get'
    2013-06-26T03:32:54.409728+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/server.rb:272:in `server'
    2013-06-26T03:32:54.426193+00:00 app[web.1]: Exiting
    2013-06-26T03:32:54.409728+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/commands.rb:55:in `block in <top (required)>'
    2013-06-26T03:32:54.409728+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/commands.rb:50:in `tap'
    2013-06-26T03:32:54.409728+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/commands/server.rb:59:in `start'
    2013-06-26T03:32:54.409728+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/commands.rb:50:in `<top (required)>'
    2013-06-26T03:32:54.409728+00:00 app[web.1]:    from script/rails:6:in `require'
    2013-06-26T03:32:54.409728+00:00 app[web.1]:    from script/rails:6:in `<main>'
    2013-06-26T03:32:55.409933+00:00 heroku[web.1]: Process exited with status 1
    2013-06-26T03:32:55.424202+00:00 heroku[web.1]: State changed from starting to crashed
    2013-06-26T03:42:57.889181+00:00 heroku[web.1]: State changed from crashed to starting
    2013-06-26T03:43:02.239973+00:00 heroku[web.1]: Starting process with command `bundle exec rails server thin -p 56589 -e $RACK_ENV`
    2013-06-26T03:43:05.359693+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency'
    2013-06-26T03:43:05.359693+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
    2013-06-26T03:43:05.359693+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/handler/thin.rb:1:in `<top (required)>'
    2013-06-26T03:43:05.359693+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/handler.rb:20:in `const_get'
    2013-06-26T03:43:05.359693+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/handler.rb:20:in `block in get'
    2013-06-26T03:43:05.359693+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/handler.rb:20:in `each'
    2013-06-26T03:43:05.359693+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/handler.rb:20:in `inject'
    2013-06-26T03:43:05.359693+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/handler.rb:20:in `get'
    2013-06-26T03:43:05.359889+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/server.rb:272:in `server'
    2013-06-26T03:43:05.359889+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/commands/server.rb:59:in `start'
    2013-06-26T03:43:05.359889+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/commands.rb:55:in `block in <top (required)>'
    2013-06-26T03:43:05.359889+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/commands.rb:50:in `tap'
    2013-06-26T03:43:05.359889+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/commands.rb:50:in `<top (required)>'
    2013-06-26T03:43:05.359889+00:00 app[web.1]:    from script/rails:6:in `require'
    2013-06-26T03:43:05.359889+00:00 app[web.1]:    from script/rails:6:in `<main>'
    2013-06-26T03:43:05.378536+00:00 app[web.1]: Exiting
    2013-06-26T03:43:06.587742+00:00 heroku[web.1]: Process exited with status 1
    2013-06-26T03:43:05.359693+00:00 app[web.1]: /app/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require': cannot load such file -- thin (LoadError)
    2013-06-26T03:43:05.359693+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `block in require'

最佳答案

你的 Gemfile 里有 gem thin 吗?

错误告诉你找不到thin

关于ruby-on-rails - 站点在本地主机上运行正常但在 Heroku 上运行错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17311356/

相关文章:

javascript - jQuery 事件处理程序在离开 View 时停止工作

mysql - Rails SQL 中的日期比较

node.js - 我可以与 PostgreSQL 一起使用的 Knex 数据类型

sql - 如何在 select 子句中使用 union?

heroku - Imagemagick - 在 Heroku 上更改 policy.xml

Git 推送问题 - 无法在远程之上强制进行本地更改

ruby-on-rails - RestClient mailgun 错误 "message": "' from' parameter is missing"

ruby-on-rails - 为 Rails 上的列 ruby​​ 指定默认值

sql - Postgres BIGINT 超出范围

ruby-on-rails - 如何在 Rails 中从 Amazon s3 读取手动上传的文件(图像/文本)?