Heroku应用程序在部署后崩溃

时间:2012-01-11 18:02:24

标签: ruby-on-rails heroku

过去几天我一直在学习Ruby和RoR。我刚刚在我的开发机器上完成了一个虚拟应用程序,它运行得很好。在将它推送到Heroku后,应用程序崩溃了。

几天前开始,我几乎不知道Ruby和RoR。有必要弄清楚错误发生的原因有点可怕。有任何想法吗?我应该推进Heroku并在路上的每一步都进行测试,但是我猜你会生活和学习。

C:\dev\rails\cdl>heroku logs
2012-01-11T17:47:20+00:00 heroku[web.1]: Process exited
2012-01-11T17:47:23+00:00 heroku[web.1]: Starting process with command `thin -p 54920 -e production
roku.ru start`
2012-01-11T17:47:27+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/activerecord-3.1.1/li
ion_adapters/abstract/connection_specification.rb:68:in `establish_connection'
2012-01-11T17:47:27+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/activerecord-3.1.1/li
ion_adapters/abstract/connection_specification.rb:60:in `establish_connection'
2012-01-11T17:47:27+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/activerecord-3.1.1/li
ion_adapters/abstract/connection_specification.rb:55:in `establish_connection'
2012-01-11T17:47:27+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/activerecord-3.1.1/li
.rb:69:in `block (2 levels) in <class:Railtie>'
2012-01-11T17:47:27+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.1.1/l
load_hooks.rb:36:in `instance_eval'
2012-01-11T17:47:27+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.1.1/l
load_hooks.rb:43:in `block in run_load_hooks'
2012-01-11T17:47:27+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.1.1/l
load_hooks.rb:42:in `each'
2012-01-11T17:47:27+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.1.1/l
load_hooks.rb:42:in `run_load_hooks'
2012-01-11T17:47:27+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/activerecord-3.1.1/li
:2190:in `<top (required)>'
2012-01-11T17:47:27+00:00 app[web.1]:   from /app/app/models/list.rb:1:in `<top (required)>'
2012-01-11T17:47:27+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.1.1/l
dencies.rb:240:in `require'
2012-01-11T17:47:27+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.1.1/l
dencies.rb:240:in `block in require'
2012-01-11T17:47:27+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.1.1/l
load_hooks.rb:36:in `execute_hook'
2012-01-11T17:47:27+00:00 app[web.1]: /app/.bundle/gems/ruby/1.9.1/gems/activerecord-3.1.1/lib/activ
pters/abstract/connection_specification.rb:71:in `rescue in establish_connection': Please install th
gem install activerecord-postgresql-adapter` (pg is not part of the bundle. Add it to Gemfile.) (Run
2012-01-11T17:47:27+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.1.1/l
dencies.rb:225:in `load_dependency'
2012-01-11T17:47:27+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.1.1/l
dencies.rb:240:in `require'
2012-01-11T17:47:27+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.1.1/l
dencies.rb:348:in `require_or_load'
2012-01-11T17:47:27+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.1.1/l
dencies.rb:489:in `load_missing_constant'
2012-01-11T17:47:27+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.1.1/l
dencies.rb:181:in `block in const_missing'
2012-01-11T17:47:27+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.1.1/l
dencies.rb:179:in `each'
2012-01-11T17:47:27+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.1.1/l
dencies.rb:179:in `const_missing'
2012-01-11T17:47:27+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.1.1/l
ctor/methods.rb:124:in `block in constantize'
2012-01-11T17:47:27+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.1.1/l
ctor/methods.rb:123:in `each'
2012-01-11T17:47:27+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.1.1/l
ctor/methods.rb:123:in `constantize'
2012-01-11T17:47:27+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.1.1/l
ext/string/inflections.rb:43:in `constantize'
2012-01-11T17:47:27+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/actionpack-3.1.1/lib/
/para
ms_wrapper.rb:167:in `_set_wrapper_defaults'
2012-01-11T17:47:27+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/actionpack-3.1.1/lib/
lties/routes_helpers.rb:7:in `block (2 levels) in with'
2012-01-11T17:47:27+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/actionpack-3.1.1/lib/
ies/paths.rb:7:in `block (2 levels) in with'
2012-01-11T17:47:27+00:00 app[web.1]:   from /app/app/controllers/lists_controller.rb:1:in `<top (re
2012-01-11T17:47:27+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.1.1/l
dencies.rb:240:in `require'
2012-01-11T17:47:27+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.1.1/l
dencies.rb:240:in `block in require'
2012-01-11T17:47:27+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/actionpack-3.1.1/lib/
/params_wrapper.rb:148:in `_default_wrap_model'
2012-01-11T17:47:27+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.1.1/l
dencies.rb:225:in `load_dependency'
2012-01-11T17:47:27+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.1.1/l
dencies.rb:240:in `require'
2012-01-11T17:47:27+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.1.1/l
dencies.rb:348:in `require_or_load'
2012-01-11T17:47:27+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/actionpack-3.1.1/lib/
/params_wrapper.rb:128:in `inherited'
2012-01-11T17:47:27+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.1.1/l
dencies.rb:214:in `require_dependency'
2012-01-11T17:47:27+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.1.1/lib/ra
lock (2 levels) in eager_load!'
2012-01-11T17:47:27+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.1.1/lib/ra
ach'
2012-01-11T17:47:27+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.1.1/lib/ra
lock in eager_load!'
2012-01-11T17:47:27+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.1.1/lib/ra
ach'
2012-01-11T17:47:27+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.1.1/lib/ra
ager_load!'
2012-01-11T17:47:27+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.1.1/lib/ra
:in `instance_exec'
2012-01-11T17:47:27+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.1.1/lib/ra
:in `run'
2012-01-11T17:47:27+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.1.1/lib/ra
:in `block in run_initializers'
2012-01-11T17:47:27+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.1.1/lib/ra
:in `each'
2012-01-11T17:47:27+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.1.1/lib/ra
:in `run_initializers'
2012-01-11T17:47:27+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.1.1/lib/ra
n `initialize!'
2012-01-11T17:47:27+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.1.1/lib/ra
e.rb:30:in `method_missing'
2012-01-11T17:47:27+00:00 app[web.1]:   from /app/config/environment.rb:5:in `<top (required)>'
2012-01-11T17:47:27+00:00 app[web.1]:   from <internal:lib/rubygems/custom_require>:29:in `require'
2012-01-11T17:47:27+00:00 app[web.1]:   from <internal:lib/rubygems/custom_require>:29:in `require'
2012-01-11T17:47:27+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.1.1/lib/ra
r.rb:51:in `block in <module:Finisher>'

2012-01-11T17:47:27+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.1.1/l
dencies.rb:302:in `depend_on'
2012-01-11T17:47:27+00:00 app[web.1]:   from config.ru:3:in `block (3 levels) in <main>'
2012-01-11T17:47:27+00:00 app[web.1]:   from /home/heroku_rack/heroku.ru:23:in `eval'
2012-01-11T17:47:27+00:00 app[web.1]:   from /home/heroku_rack/heroku.ru:23:in `block (3 levels) in
2012-01-11T17:47:27+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/rack-1.3.6/lib/rack/b
ce_eval'
2012-01-11T17:47:27+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/rack-1.3.6/lib/rack/b
lize'
2012-01-11T17:47:27+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/rack-1.3.6/lib/rack/b
2012-01-11T17:47:27+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/rack-1.3.6/lib/rack/b
ce_eval'
2012-01-11T17:47:27+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/rack-1.3.6/lib/rack/b
lize'
2012-01-11T17:47:27+00:00 app[web.1]:   from /home/heroku_rack/heroku.ru:11:in `new'
2012-01-11T17:47:27+00:00 app[web.1]:   from /home/heroku_rack/heroku.ru:11:in `block in <main>'
2012-01-11T17:47:27+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/rack-1.3.6/lib/rack/b
ce_eval'
2012-01-11T17:47:27+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/rack-1.3.6/lib/rack/b
2012-01-11T17:47:27+00:00 app[web.1]:   from /home/heroku_rack/heroku.ru:18:in `block (2 levels) in
2012-01-11T17:47:27+00:00 app[web.1]:   from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/thin-1.2.6/lib/
36:in `eval'
2012-01-11T17:47:27+00:00 app[web.1]:   from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/thin-1.2.6/lib/
ller.rb:175:in `load_rackup_config'
2012-01-11T17:47:27+00:00 app[web.1]:   from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/thin-1.2.6/lib/
run_command'
2012-01-11T17:47:27+00:00 app[web.1]:   from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/thin-1.2.6/bin/
ed)>'
2012-01-11T17:47:27+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/rack-1.3.6/lib/rack/b
lize'
2012-01-11T17:47:27+00:00 app[web.1]:   from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/thin-1.2.6/lib/
ller.rb:65:in `start'
2012-01-11T17:47:27+00:00 app[web.1]:   from /home/heroku_rack/heroku.ru:1:in `new'
2012-01-11T17:47:27+00:00 app[web.1]:   from /home/heroku_rack/heroku.ru:1:in `<main>'
2012-01-11T17:47:27+00:00 app[web.1]:   from /usr/ruby1.9.2/bin/thin:19:in `load'
2012-01-11T17:47:27+00:00 app[web.1]:   from /usr/ruby1.9.2/bin/thin:19:in `<main>'
2012-01-11T17:47:27+00:00 app[web.1]:   from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/thin-1.2.6/lib/

run!'
2012-01-11T17:47:27+00:00 app[web.1]:   from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/thin-1.2.6/lib/
36:in `load'
2012-01-11T17:47:28+00:00 heroku[web.1]: State changed from starting to crashed
2012-01-11T17:47:29+00:00 heroku[web.1]: Process exited
2012-01-11T17:48:13+00:00 heroku[router]: Error H10 (App crashed) -> GET electric-moon-9885.heroku.c
service= status=503 bytes=
2012-01-11T17:48:13+00:00 heroku[router]: Error H10 (App crashed) -> GET electric-moon-9885.heroku.c
eue= wait= service= status=503 bytes=
2012-01-11T17:48:24+00:00 heroku[router]: Error H10 (App crashed) -> GET electric-moon-9885.heroku.c
service= status=503 bytes=
2012-01-11T17:48:24+00:00 heroku[router]: Error H10 (App crashed) -> GET electric-moon-9885.heroku.c
eue= wait= service= status=503 bytes=
2012-01-11T17:48:54+00:00 heroku[router]: Error H10 (App crashed) -> GET electric-moon-9885.heroku.c
eue= wait= service= status=503 bytes=
2012-01-11T17:48:54+00:00 heroku[router]: Error H10 (App crashed) -> GET electric-moon-9885.heroku.c
service= status=503 bytes=
2012-01-11T17:50:24+00:00 heroku[router]: Error H10 (App crashed) -> GET electric-moon-9885.heroku.c
service= status=503 bytes=
2012-01-11T17:50:24+00:00 heroku[router]: Error H10 (App crashed) -> GET electric-moon-9885.heroku.c
eue= wait= service= status=503 bytes=
2012-01-11T17:50:25+00:00 heroku[router]: Error H10 (App crashed) -> GET electric-moon-9885.heroku.c
service= status=503 bytes=
2012-01-11T17:50:25+00:00 heroku[router]: Error H10 (App crashed) -> GET electric-moon-9885.heroku.c
eue= wait= service= status=503 bytes=
2012-01-11T17:50:27+00:00 heroku[router]: Error H10 (App crashed) -> GET electric-moon-9885.heroku.c
service= status=503 bytes=
2012-01-11T17:50:28+00:00 heroku[router]: Error H10 (App crashed) -> GET electric-moon-9885.heroku.c
eue= wait= service= status=503 bytes=
2012-01-11T17:56:57+00:00 heroku[router]: Error H10 (App crashed) -> GET electric-moon-9885.heroku.c
service= status=503 bytes=
2012-01-11T17:56:58+00:00 heroku[router]: Error H10 (App crashed) -> GET electric-moon-9885.heroku.c
eue= wait= service= status=503 bytes=
2012-01-11T17:57:37+00:00 heroku[web.1]: State changed from crashed to created
2012-01-11T17:57:37+00:00 heroku[web.1]: State changed from created to starting
2012-01-11T17:57:44+00:00 heroku[web.1]: State changed from starting to crashed

1 个答案:

答案 0 :(得分:2)

深入了解您的日志文件。有这一行:

Please install the
gem install activerecord-postgresql-adapter` (pg is not part of the bundle. Add it to       Gemfile.)

基本上,(很有可能)您尝试使用sqlite3服务器运行Heroku实例,但它不支持。在您的gemfile中,您需要输入以下内容:

group :development, :test do
   gem 'sqlite3'
end

group :production do
   gem 'pg'
end

重新投入,投入并重新投入Heroku,你应该没事。