Heroku应用程序崩溃,收到“Invalid DATABASE URL”当尝试heroku rake db:migrate [英] Heroku app crashed, receiving "Invalid DATABASE URL" when attempting heroku rake db:migrate

查看:106
本文介绍了Heroku应用程序崩溃,收到“Invalid DATABASE URL”当尝试heroku rake db:migrate的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是编程新手,在尝试heroku rake db时遇到了Michael Hartl的Rails教程:migrate

 (in / app)
/app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2/lib/rake/file_utils.rb:10:警告:已经初始化常量RUBY
/app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2/lib/rake/file_utils.rb:84:警告:已经初始化常量LN_SUPPORTED
rake中止!
无效DATABASE_URL
(erb):9:在`rescue in< main>'
(erb):6:在< main>'
/ usr / ruby​​1 .9.2 / lib / ruby​​ / 1.9.1 / erb.rb:753:在`eval'
/usr/ruby1.9.2/lib/ruby/1.9.1/erb.rb:753:in`result'
/app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.1/lib/rails/application/configuration.rb:86:in`database_configuration'
/ app /。 bundle / gems / ruby​​ / 1.9.1 / gems / activerecord-3.0.1 / lib / active_record / railtie.rb:58:在< class:Railtie>'
/ app / .bundle / gems / ruby​​ / 1.9.1 / gems / activesupport-3.0.1 / lib / active_support / lazy_load_hooks.rb:36:在`instance_eval'
/app/.bundle/gems/ruby/1.9.1 /gems/activesupport-3.0.1/lib/active_support/lazy_load_hooks.rb:36:in`execute_hook'
/app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.0.1/lib /active_support/lazy_load_hooks.rb:43:'run_load_hooks中的块'
/app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.0.1/lib/active_support/lazy_load_hooks.rb:42 :在`each'
/app/.bundle/gems/ruby/1.9中.1 / gems / activesupport-3.0.1 / lib / active_support / lazy_load_hooks.rb:42:在`run_load_hooks'
/app/.bundle/gems/ruby/1.9.1/gems/activerecord-3.0.1 /lib/active_record/base.rb:1867:in`< top(required)>'
/app/.bundle/gems/ruby/1.9.1/gems/activerecord-3.0.1/lib/ active_record / migration.rb:486:在`initialize'
/app/.bundle/gems/ruby/1.9.1/gems/activerecord-3.0.1/lib/active_record/migration.rb:433:in`新'
/app/.bundle/gems/ruby/1.9.1/gems/activerecord-3.0.1/lib/active_record/migration.rb:433:in'up'
/ app /。 bundle / gems / ruby​​ / 1.9.1 / gems / activerecord-3.0.1 / lib / active_record / migration.rb:415:在'migrate'中
/app/.bundle/gems/ruby/1.9.1/ gems / activerecord-3.0.1 / lib / active_record / railties / databases.rake:142:在< top(required)>中的block(2 levels)'
/usr/ruby1.9.2/lib/ ruby / 1.9.1 / rake.rb:634:在`call'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:634:in`block in execute'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:629:in`each'
/usr/ruby1.9.2/l ib / ruby​​ / 1.9.1 / rake.rb:629:在`execute'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:595:in`block in invoke_with_call_chain'
/usr/ruby1.9.2/lib/ruby/1.9.1/monitor.rb:201:in`mon_synchronize'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb :588:在`invoke_with_call_chain'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:581:in`invoke'
/usr/ruby1.9.2/lib/ruby /1.9.1/rake.rb:2041:in`invoke_task'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:2019:in`block(2 levels)in top_level'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:2019:in`each'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake。 rb:2019:在`block in top_level'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:2058:in`standard_exception_handling'
/usr/ruby1.9.2/ lib / ruby​​ / 1.9.1 / rake.rb:2013:在`top_level'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:1992:in`run'
/usr/ruby1.9.2/bin/rake:31:in`< main>'

该应用程序完美地在localserver上运行,但完全崩溃, p>


应用程序发生错误,您的页面无法投放。请稍后再试。



如果您是应用程序所有者,请查看日志以获取详细信息。


我在日志中收到此错误

  2011-06-13T20:20:47 + 00 :00 app [web.1]:from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.1/lib/rails/initializable.rb:25:in`instance_exec'
2011-06-13T20:20:47 + 00:00 app [web.1]:from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.1/lib/rails/initializable.rb :25:在'跑'
2011-06-13T20:20:47 + 00:00 heroku [web.1]:进程已退出
2011-06-13T20:20:48 + 00:00 heroku [web.1]:状态从开始变为崩溃
2011-06-13T20:21:29 + 00:00 heroku [router]:错误H10(应用程序崩溃) - > GET深层访问-590.heroku.com/ dyno = queue = wait = service = bytes =
2011-06-13T13:21:30-07:00 heroku [nginx]:GET / HTTP / 1.1 | 86.44.102.112 | 796 | http | 503
2011-06-13T20:24:25 + 00:00 heroku [web.1]:状态从坠毁改为创建
2011-06-13T20:24:25 + 00:00 heroku [ web.1]:从创建状态变为启动
2011-06-13T20:24:31 + 00:00 heroku [web.1]:用命令启动进程:`thin -p 16433 -e production -R /home/heroku_rack/heroku.ru start`

任何人都认为他们知道是什么导致应用程序崩溃?

编辑:重启后有更多日志

  2011-06- 14T12:22:46 + 00:00 heroku [web.1]:状态从开始变为崩溃
2011-06-14T12:32:32 + 00:00 heroku [web.1]:状态从崩溃状态改变创建
2011-06-14T12:32:32 + 00:00 heroku [web.1]:从创建状态更改为开始
2011-06-14T12:32:42 + 00:00 heroku [web.1]:用命令启动进程:`thin -p 14587 -e production -R /home/heroku_rack/heroku.ru start`
2011-06-14T12:32:45 + 00:00 app [ (erb):9:在`rescue in< main>'中:无效的DATABASE_URL(RuntimeError)
2011-06-14T12:32:45 + 00:00 app [web.1]:from(erb):6:in< main>'
2011-06-14T12:32: 45 + 00:00 app [web.1]:from /usr/ruby1.9.2/lib/ruby/1.9.1/erb.rb:753:in`eval'
2011-06-14T12:32: 45 + 00:00 app [web.1]:from /usr/ruby1.9.2/lib/ruby/1.9.1/erb.rb:753:in`result'
2011-06-14T12:32: 45 + 00:00应用[web.1]:从/app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.1/lib/rails/application/configuration.rb:86:in`database_configuration '
2011-06-14T12:32:45 + 00:00 app [web.1]:from /app/.bundle/gems/ruby/1.9.1/gems/activerecord-3.0.1/lib/ active_record / railtie.rb:58:在< class:Railtie>'
2011-06-14T12:32:45 + 00:00应用[web.1]中的块(2级)中:from / app /.bundle/gems/ruby/1.9.1/gems/activesupport-3.0.1/lib/active_support/lazy_load_hooks.rb:36:in`instance_eval'
2011-06-14T12:32:45 + 00: 00 app [web.1]:from /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.0.1/lib/active_support/lazy_load_hooks.rb:36:in`execute_hook'
2011 -06-14T12:32:45 + 00: 00 heroku [web.1]:进程退出
2011-06-14T12:32:46 + 00:00 heroku [web.1]:状态从开始变为崩溃
2011-06-14T12: 45:03 + 00:00 heroku [web.1]:状态从崩溃状态变为创建状态
2011-06-14T12:45:03 + 00:00 heroku [web.1]:状态从创建状态变为启动状态
2011-06-14T12:45:08 + 00:00 heroku [web.1]:用命令启动进程:`thin -p 15727 -e production -R /home/heroku_rack/heroku.ru start`
2011-06-14T12:45:11 + 00:00 app [web.1]:(erb):9:in`rescue in< main>':无效DATABASE_URL(RuntimeError)
2011- 06-14T12:45:11 + 00:00 app [web.1]:from(erb):6:in< main>'
2011-06-14T12:45:11 + 00:00 app [web.1]:从/usr/ruby1.9.2/lib/ruby/1.9.1/erb.rb:753:in`eval'
2011-06-14T12:45:11 + 00:00 app [web.1]:从/usr/ruby1.9.2/lib/ruby/1.9.1/erb.rb:753:in'result'
2011-06-14T12:45:11 + 00:00 app [web.1]:从/app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.1/lib/rails/application/configuration.rb:86:in`database_configurat ion'
2011-06-14T12:45:11 + 00:00 app [web.1]:from /app/.bundle/gems/ruby/1.9.1/gems/activerecord-3.0.1/lib /active_record/railtie.rb:58:in< class:Railtie>'
2011-06-14T12:45:11 + 00:00 app中的block(2 levels)应用[web.1]:from / app / .bundle / gems / ruby​​ / 1.9.1 / gems / activesupport-3.0.1 / lib / active_support / lazy_load_hooks.rb:36:in`instance_eval'
2011-06-14T12:45:11 + 00 :00 app [web.1]:from /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.0.1/lib/active_support/lazy_load_hooks.rb:36:in`execute_hook'
2011-06-14T12:45:11 + 00:00 app [web.1]:from /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.0.1/lib/active_support/lazy_load_hooks.rb :43:在`block in run_load_hooks'
2011-06-14T12:45:11 + 00:00 app [web.1]:from /app/.bundle/gems/ruby/1.9.1/gems/ activesupport-3.0.1 / lib / active_support / lazy_load_hooks.rb:42:在`each'
2011-06-14T12:45:11 + 00:00 app [web.1]:from /app/.bundle /gems/ruby/1.9.1/gems/activesupport-3.0.1/lib/active_support/lazy_load_hooks.rb:42: in'run_load_hooks'
2011-06-14T12:45:11 + 00:00 app [web.1]:from /app/.bundle/gems/ruby/1.9.1/gems/activerecord-3.0.1 /lib/active_record/base.rb:1867:in`< top(required)>'
2011-06-14T12:45:11 + 00:00 app [web.1]:from / app / app / models / user.rb:14:在< top(required)>'
2011-06-14T12:45:11 + 00:00 app [web.1]:from / app /中。 bundle / gems / ruby​​ / 1.9.1 / gems / activesupport-3.0.1 / lib / active_support / dependencies.rb:239:在'require'
2011-06-14T12:45:11 + 00:00 app [web.1]:from /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:239:in`block in require'
2011 -06-14T12:45:11 + 00:00应用[web.1]:从/app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.0.1/lib/active_support/dependencies.rb: 227:在`load_dependency'
2011-06-14T12:45:11 + 00:00 app [web.1]中:from /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.0 .1 / lib / active_support / dependencies.rb:239:在'require'
2011-06-14T12:45:11 + 00:00 app [web.1]:from /app/.bu ndle / gems / ruby​​ / 1.9.1 / gems / activesupport-3.0.1 / lib / active_support / dependencies.rb:346:在'require_or_load'
2011-06-14T12:45:11 + 00:00 app [web.1]:从/app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:300:in`depend_on'
2011-06 -14T12:45:11 + 00:00 app [web.1]:from /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:216: 'require_dependency'
2011-06-14T12:45:11 + 00:00 app [web.1]:from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.1 /lib/rails/engine.rb:138:in'block(2 levels)in eager_load!'
2011-06-14T12:45:11 + 00:00 app [web.1]:from / app / .bundle / gems / ruby​​ / 1.9.1 / gems / railties-3.0.1 / lib / rails / engine.rb:137:在`each'
2011-06-14T12:45:11 + 00:00 app [web.1]:from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.1/lib/rails/engine.rb:137:in`block in eager_load!'
2011-06-14T12:45:11 + 00:00 app [web.1]:from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.1/lib/rails/engine .rb:135:在'each'
2011-06-14T12:45:11 + 00:00 app [web.1]:from /app/.bundle/gems/ruby/1.9.1/gems/ railties-3.0.1 / lib / rails / engine.rb:135:在`eager_load!'
2011-06-14T12:45:11 + 00:00 app [web.1]:from / app /中。 bundle / gems / ruby​​ / 1.9.1 / gems / railties-3.0.1 / lib / rails / application.rb:108:在`eager_load!'
2011-06-14T12:45:11 + 00:00 app [web.1]:from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.1/lib/rails/application/finisher.rb:41:in`block in< module:整理器>'
2011-06-14T12:45:11 + 00:00 app [web.1]:from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.1/ lib / rails / initializable.rb:25:在`instance_exec'
2011-06-14T12:45:11 + 00:00 app [web.1]:from /app/.bundle/gems/ruby/1.9 .1 / gems / railties-3.0.1 / lib / rails / initializable.rb:25:在'run'中
2011-06-14T12:45:11 + 00:00 app [web.1]:from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.1/lib/rails/initializable.rb:50:in`block in run_initializers'
2011-06-14T12:45: 11 + 00:00应用[web.1]:从/app/.bundle/ gems / ruby​​ / 1.9.1 / gems / railties-3.0.1 / lib / rails / initializable.rb:49:在`each'
2011-06-14T12:45:11 + 00:00 app [web .1]:从/app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.1/lib/rails/initializable.rb:49:in`run_initializers'
2011-06-14T12 :45:11 + 00:00 app [web.1]:from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.1/lib/rails/application.rb:134:in`初始化!'
2011-06-14T12:45:11 + 00:00 app [web.1]:from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.1/ lib / rails / application.rb:77:在`method_missing'
2011-06-14T12:45:11 + 00:00 app [web.1]:from /app/config/environment.rb:5:从< internal:lib / ruby​​gems / custom_require>:<< top(required)>'
2011-06-14T12:45:11 + 00:00 app [web.1]:in: 'require'
2011-06-14T12:45:11 + 00:00 app [web.1]:from< internal:lib / ruby​​gems / custom_require>:29:'require'
2011 -06-14T12:45:11 + 00:00 app [web.1]:from config.ru:3:in`block(3 levels)in< main>'
2011-06-14T12:45 :11 + 00:00应用[w eb.1]:from /home/heroku_rack/heroku.ru:23:in`eval'
2011-06-14T12:45:11 + 00:00 app [web.1]:from / home / heroku_rack /heroku.ru:23:in在< main>'
2011-06-14T12:45:11 + 00:00 app [web.1]中拦截(3层):from /app/.bundle /gems/ruby/1.9.1/gems/rack-1.2.3/lib/rack/builder.rb:46:in`instance_eval'
2011-06-14T12:45:11 + 00:00 app [ web.1]:从/app/.bundle/gems/ruby/1.9.1/gems/rack-1.2.3/lib/rack/builder.rb:46:in`initialize'
2011-06- 14T12:45:11 + 00:00 app [web.1]:from /app/.bundle/gems/ruby/1.9.1/gems/rack-1.2.3/lib/rack/builder.rb:63:in `new'
2011-06-14T12:45:11 + 00:00 app [web.1]:from /app/.bundle/gems/ruby/1.9.1/gems/rack-1.2.3/ lib / rack / builder.rb:63:在`map'
2011-06-14T12:45:11 + 00:00 app [web.1]:from /home/heroku_rack/heroku.ru:18:在< main>'
2011-06-14T12:45:11 + 00:00 app [web.1]中的块(2级)中:from /app/.bundle/gems/ruby/1.9。 1 / gems / rack-1.2.3 / lib / rack / builder.rb:46:in`instance_eval'
2011-06-14T12:45:11 + 00:0 0 app [web.1]:from /home/heroku_rack/heroku.ru:11:in`block in< main>'
2011-06-14T12:45:11 + 00:00 app [web。 1]:from /app/.bundle/gems/ruby/1.9.1/gems/rack-1.2.3/lib/rack/builder.rb:46:in`initialize'
2011-06-14T12: 45:11 + 00:00 app [web.1]:from /home/heroku_rack/heroku.ru:1:in`new'
2011-06-14T12:45:11 + 00:00 app [web .1]:from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/thin-1.2.6/lib/thin/runner.rb:143:in`run!'
2011 -06-14T12:45:11 + 00:00 app [web.1]:from /usr/ruby1.9.2/bin/thin:19:in`load'
2011-06-14T12:45:11 +00:00 heroku [web.1]:进程退出
2011-06-14T12:45:11 + 00:00 heroku [web.1]:状态从开始变为崩溃
2011-06 -14T12:45:11 + 00:00 heroku [web.1]:从崩溃状态改为创建
2011-06-14T12:45:11 + 00:00 heroku [web.1]:状态从创建至起始
2011-06-14T12:45:16 + 00:00 heroku [web.1]:用命令启动进程:`thin -p 46054 -e production -R /home/heroku_rack/heroku.ru开始$
201 1-06-14T12:45:20 + 00:00 app [web.1]:(erb):9:在`rescue in< main>'中:无效DATABASE_URL(RuntimeError)
2011-06-14T12 :45:20 + 00:00 app [web.1]:from(erb):6:in< main>'
2011-06-14T12:45:20 + 00:00 app [web。 1]:from /usr/ruby1.9.2/lib/ruby/1.9.1/erb.rb:753:in`eval'
2011-06-14T12:45:20 + 00:00 app [web。 1]:from /usr/ruby1.9.2/lib/ruby/1.9.1/erb.rb:753:in`result'
2011-06-14T12:45:20 + 00:00 app [web。 1]:from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.1/lib/rails/application/configuration.rb:86:in`database_configuration'
2011-06- 14T12:45:20 + 00:00应用[web.1]:从/app/.bundle/gems/ruby/1.9.1/gems/activerecord-3.0.1/lib/active_record/railtie.rb:58:in `< class:Railtie>'
2011-06-14T12:45:20 + 00:00 app [web.1]中的块(2级):from /app/.bundle/gems/ruby/1.9 .1 / gems / activesupport-3.0.1 / lib / active_support / lazy_load_hooks.rb:36:在`instance_eval'
2011-06-14T12:45:20 + 00:00 app [web.1]:from /app/.bundle/gems/ruby/1.9.1/gems /activesupport-3.0.1/lib/active_support/lazy_load_hooks.rb:36:in`execute_hook'
2011-06-14T12:45:20 + 00:00 app [web.1]:from / app /。 bundle / gems / ruby​​ / 1.9.1 / gems / activesupport-3.0.1 / lib / active_support / lazy_load_hooks.rb:43:在`block in run_load_hooks'
2011-06-14T12:45:20 + 00: 00 app [web.1]:from /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.0.1/lib/active_support/lazy_load_hooks.rb:42:in`each'
2011 -06-14T12:45:20 + 00:00 app [web.1]:from /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.0.1/lib/active_support/lazy_load_hooks.rb: 42:在`run_load_hooks'
2011-06-14T12:45:20 + 00:00 app [web.1]:from /app/.bundle/gems/ruby/1.9.1/gems/activerecord-3.0 .1 / lib / active_record / base.rb:1867:在< top(required)>'
2011-06-14T12:45:20 + 00:00 app [web.1]:from / app / app / models / user.rb:14:在< top(required)>'
2011-06-14T12:45:20 + 00:00 app [web.1]:from / app /.bundle/gems/ruby/1.9.1/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:239:in`需要'
2011-06-14T12:45:20 + 00:00 app [web.1]:from /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.0.1/lib /active_support/dependencies.rb:239:in`block in require'
2011-06-14T12:45:20 + 00:00 app [web.1]:from /app/.bundle/gems/ruby/ 1.9.1 / gems / activesupport-3.0.1 / lib / active_support / dependencies.rb:227:在`load_dependency'
2011-06-14T12:45:20 + 00:00 app [web.1]中: from /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:239:in`require'
2011-06-14T12:45:20 +00:00 app [web.1]:从/app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:346:in'require_or_load'
2011-06-14T12:45:20 + 00:00应用[web.1]:从/app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.0.1/lib/active_support/dependencies .rb:300:在'depend_on'
2011-06-14T12:45:20 + 00:00 app [web.1]:from /app/.bundle/gems/ruby/1.9.1/gems/ activesupport-3.0.1 / lib / active_support / dependencies.rb:216:在'require_dependency'
2011-06-14T12:45:20 + 00:00 app [web.1]:from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.1/lib/rails/engine。 rb:138:在eager_load!中的块(2级)''
2011-06-14T12:45:20 + 00:00 app [web.1]:from /app/.bundle/gems/ruby/ 1.9.1 / gems / railties-3.0.1 / lib / rails / engine.rb:137:在`each'
2011-06-14T12:45:20 + 00:00 heroku [web.1]:进程退出
2011-06-14T12:45:21 + 00:00 heroku [web.1]:状态从开始变为崩溃
2011-06-14T12:45:21 + 00:00 heroku [路由器]:错误H10(应用程序崩溃) - > GET deep_beach-590.heroku.com/ dyno = queue = wait = service = bytes =
2011-06-14T05:45:21-07:00 heroku [nginx]:GET / HTTP / 1.1 | 86.44.102.112 | 796 | http | 503
2011-06-14T12:45:21 + 00:00 heroku [router]:Error H10(App crashed) - > GET deep-beach-590.heroku.com/favicon.ico dyno = queue = wait = service = bytes =

我认为这里更简单的解决方案可能是销毁应用程序并重新开始。 解决方案

很可能你错过了共享数据库插件。

  heroku addons:添加共享数据库

请参阅 https://devcenter.heroku .com / articles / database#疑难解答


I'm new to Programming and was following the Rails Tutorial by Michael Hartl when I ran into this while attempting heroku rake db:migrate

(in /app)
/app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2/lib/rake/file_utils.rb:10: warning: already initialized constant RUBY
/app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2/lib/rake/file_utils.rb:84: warning: already initialized constant LN_SUPPORTED
rake aborted!
Invalid DATABASE_URL
(erb):9:in `rescue in <main>'
(erb):6:in `<main>'
/usr/ruby1.9.2/lib/ruby/1.9.1/erb.rb:753:in `eval'
/usr/ruby1.9.2/lib/ruby/1.9.1/erb.rb:753:in `result'
/app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.1/lib/rails/application/configuration.rb:86:in `database_configuration'
/app/.bundle/gems/ruby/1.9.1/gems/activerecord-3.0.1/lib/active_record/railtie.rb:58:in `block (2 levels) in <class:Railtie>'
/app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.0.1/lib/active_support/lazy_load_hooks.rb:36:in `instance_eval'
/app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.0.1/lib/active_support/lazy_load_hooks.rb:36:in `execute_hook'
/app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.0.1/lib/active_support/lazy_load_hooks.rb:43:in `block in run_load_hooks'
/app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.0.1/lib/active_support/lazy_load_hooks.rb:42:in `each'
/app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.0.1/lib/active_support/lazy_load_hooks.rb:42:in `run_load_hooks'
/app/.bundle/gems/ruby/1.9.1/gems/activerecord-3.0.1/lib/active_record/base.rb:1867:in `<top (required)>'
/app/.bundle/gems/ruby/1.9.1/gems/activerecord-3.0.1/lib/active_record/migration.rb:486:in `initialize'
/app/.bundle/gems/ruby/1.9.1/gems/activerecord-3.0.1/lib/active_record/migration.rb:433:in `new'
/app/.bundle/gems/ruby/1.9.1/gems/activerecord-3.0.1/lib/active_record/migration.rb:433:in `up'
/app/.bundle/gems/ruby/1.9.1/gems/activerecord-3.0.1/lib/active_record/migration.rb:415:in `migrate'
/app/.bundle/gems/ruby/1.9.1/gems/activerecord-3.0.1/lib/active_record/railties/databases.rake:142:in `block (2 levels) in <top (required)>'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:634:in `call'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:634:in `block in execute'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:629:in `each'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:629:in `execute'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:595:in `block in invoke_with_call_chain'
/usr/ruby1.9.2/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:588:in `invoke_with_call_chain'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:581:in `invoke'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:2041:in `invoke_task'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:2019:in `block (2 levels) in top_level'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:2019:in `each'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:2019:in `block in top_level'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:2058:in `standard_exception_handling'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:2013:in `top_level'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:1992:in `run'
/usr/ruby1.9.2/bin/rake:31:in `<main>' 

The application works perfectly on localserver but has crashed completely saying

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.

I get this error in logs

2011-06-13T20:20:47+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.1/lib/rails/initializable.rb:25:in `instance_exec'
2011-06-13T20:20:47+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.1/lib/rails/initializable.rb:25:in `run'
2011-06-13T20:20:47+00:00 heroku[web.1]: Process exited
2011-06-13T20:20:48+00:00 heroku[web.1]: State changed from starting to crashed
2011-06-13T20:21:29+00:00 heroku[router]: Error H10 (App crashed) -> GET deep-beach-590.heroku.com/ dyno= queue= wait= service= bytes=
2011-06-13T13:21:30-07:00 heroku[nginx]: GET / HTTP/1.1 | 86.44.102.112 | 796 | http | 503
2011-06-13T20:24:25+00:00 heroku[web.1]: State changed from crashed to created
2011-06-13T20:24:25+00:00 heroku[web.1]: State changed from created to starting
2011-06-13T20:24:31+00:00 heroku[web.1]: Starting process with command: `thin -p 16433 -e production -R /home/heroku_rack/heroku.ru start`

Anyone think they know what's causing the app to crash?

edit: with more logs after restart

2011-06-14T12:22:46+00:00 heroku[web.1]: State changed from starting to crashed
2011-06-14T12:32:32+00:00 heroku[web.1]: State changed from crashed to created
2011-06-14T12:32:32+00:00 heroku[web.1]: State changed from created to starting
2011-06-14T12:32:42+00:00 heroku[web.1]: Starting process with command: `thin -p 14587 -e production -R /home/heroku_rack/heroku.ru start`
2011-06-14T12:32:45+00:00 app[web.1]: (erb):9:in `rescue in <main>': Invalid DATABASE_URL (RuntimeError)
2011-06-14T12:32:45+00:00 app[web.1]:   from (erb):6:in `<main>'
2011-06-14T12:32:45+00:00 app[web.1]:   from /usr/ruby1.9.2/lib/ruby/1.9.1/erb.rb:753:in `eval'
2011-06-14T12:32:45+00:00 app[web.1]:   from /usr/ruby1.9.2/lib/ruby/1.9.1/erb.rb:753:in `result'
2011-06-14T12:32:45+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.1/lib/rails/application/configuration.rb:86:in `database_configuration'
2011-06-14T12:32:45+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/activerecord-3.0.1/lib/active_record/railtie.rb:58:in `block (2 levels) in <class:Railtie>'
2011-06-14T12:32:45+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.0.1/lib/active_support/lazy_load_hooks.rb:36:in `instance_eval'
2011-06-14T12:32:45+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.0.1/lib/active_support/lazy_load_hooks.rb:36:in `execute_hook'
2011-06-14T12:32:45+00:00 heroku[web.1]: Process exited
2011-06-14T12:32:46+00:00 heroku[web.1]: State changed from starting to crashed
2011-06-14T12:45:03+00:00 heroku[web.1]: State changed from crashed to created
2011-06-14T12:45:03+00:00 heroku[web.1]: State changed from created to starting
2011-06-14T12:45:08+00:00 heroku[web.1]: Starting process with command: `thin -p 15727 -e production -R /home/heroku_rack/heroku.ru start`
2011-06-14T12:45:11+00:00 app[web.1]: (erb):9:in `rescue in <main>': Invalid DATABASE_URL (RuntimeError)
2011-06-14T12:45:11+00:00 app[web.1]:   from (erb):6:in `<main>'
2011-06-14T12:45:11+00:00 app[web.1]:   from /usr/ruby1.9.2/lib/ruby/1.9.1/erb.rb:753:in `eval' 
2011-06-14T12:45:11+00:00 app[web.1]:   from /usr/ruby1.9.2/lib/ruby/1.9.1/erb.rb:753:in `result'
2011-06-14T12:45:11+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.1/lib/rails/application/configuration.rb:86:in `database_configuration'
2011-06-14T12:45:11+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/activerecord-3.0.1/lib/active_record/railtie.rb:58:in `block (2 levels) in <class:Railtie>'
2011-06-14T12:45:11+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.0.1/lib/active_support/lazy_load_hooks.rb:36:in `instance_eval'
2011-06-14T12:45:11+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.0.1/lib/active_support/lazy_load_hooks.rb:36:in `execute_hook'
2011-06-14T12:45:11+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.0.1/lib/active_support/lazy_load_hooks.rb:43:in `block in run_load_hooks'
2011-06-14T12:45:11+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.0.1/lib/active_support/lazy_load_hooks.rb:42:in `each'
2011-06-14T12:45:11+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.0.1/lib/active_support/lazy_load_hooks.rb:42:in `run_load_hooks'
2011-06-14T12:45:11+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/activerecord-3.0.1/lib/active_record/base.rb:1867:in `<top (required)>'
2011-06-14T12:45:11+00:00 app[web.1]:   from /app/app/models/user.rb:14:in `<top (required)>'
2011-06-14T12:45:11+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:239:in `require'
2011-06-14T12:45:11+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:239:in `block in require'
2011-06-14T12:45:11+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:227:in `load_dependency'
2011-06-14T12:45:11+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:239:in `require'
2011-06-14T12:45:11+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:346:in `require_or_load'
2011-06-14T12:45:11+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:300:in `depend_on'
2011-06-14T12:45:11+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:216:in `require_dependency'
2011-06-14T12:45:11+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.1/lib/rails/engine.rb:138:in `block (2 levels) in eager_load!'
2011-06-14T12:45:11+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.1/lib/rails/engine.rb:137:in `each'
2011-06-14T12:45:11+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.1/lib/rails/engine.rb:137:in `block in eager_load!'
2011-06-14T12:45:11+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.1/lib/rails/engine.rb:135:in `each'
2011-06-14T12:45:11+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.1/lib/rails/engine.rb:135:in `eager_load!'
2011-06-14T12:45:11+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.1/lib/rails/application.rb:108:in `eager_load!'
2011-06-14T12:45:11+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.1/lib/rails/application/finisher.rb:41:in `block in <module:Finisher>'
2011-06-14T12:45:11+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.1/lib/rails/initializable.rb:25:in `instance_exec'
2011-06-14T12:45:11+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.1/lib/rails/initializable.rb:25:in `run'
2011-06-14T12:45:11+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.1/lib/rails/initializable.rb:50:in `block in run_initializers'
2011-06-14T12:45:11+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.1/lib/rails/initializable.rb:49:in `each'
2011-06-14T12:45:11+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.1/lib/rails/initializable.rb:49:in `run_initializers'
2011-06-14T12:45:11+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.1/lib/rails/application.rb:134:in `initialize!'
2011-06-14T12:45:11+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.1/lib/rails/application.rb:77:in `method_missing'
2011-06-14T12:45:11+00:00 app[web.1]:   from /app/config/environment.rb:5:in `<top (required)>'
2011-06-14T12:45:11+00:00 app[web.1]:   from <internal:lib/rubygems/custom_require>:29:in `require'
2011-06-14T12:45:11+00:00 app[web.1]:   from <internal:lib/rubygems/custom_require>:29:in `require'
2011-06-14T12:45:11+00:00 app[web.1]:   from config.ru:3:in `block (3 levels) in <main>'
2011-06-14T12:45:11+00:00 app[web.1]:   from /home/heroku_rack/heroku.ru:23:in `eval'
2011-06-14T12:45:11+00:00 app[web.1]:   from /home/heroku_rack/heroku.ru:23:in `block (3 levels) in <main>'
2011-06-14T12:45:11+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/rack-1.2.3/lib/rack/builder.rb:46:in `instance_eval'
2011-06-14T12:45:11+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/rack-1.2.3/lib/rack/builder.rb:46:in `initialize'
2011-06-14T12:45:11+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/rack-1.2.3/lib/rack/builder.rb:63:in `new'
2011-06-14T12:45:11+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/rack-1.2.3/lib/rack/builder.rb:63:in `map'
2011-06-14T12:45:11+00:00 app[web.1]:   from /home/heroku_rack/heroku.ru:18:in `block (2 levels) in <main>'
2011-06-14T12:45:11+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/rack-1.2.3/lib/rack/builder.rb:46:in `instance_eval'
2011-06-14T12:45:11+00:00 app[web.1]:   from /home/heroku_rack/heroku.ru:11:in `block in <main>'
2011-06-14T12:45:11+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/rack-1.2.3/lib/rack/builder.rb:46:in `initialize'
2011-06-14T12:45:11+00:00 app[web.1]:   from /home/heroku_rack/heroku.ru:1:in `new'
2011-06-14T12:45:11+00:00 app[web.1]:   from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/thin-1.2.6/lib/thin/runner.rb:143:in `run!'
2011-06-14T12:45:11+00:00 app[web.1]:   from /usr/ruby1.9.2/bin/thin:19:in `load'
2011-06-14T12:45:11+00:00 heroku[web.1]: Process exited
2011-06-14T12:45:11+00:00 heroku[web.1]: State changed from starting to crashed
2011-06-14T12:45:11+00:00 heroku[web.1]: State changed from crashed to created
2011-06-14T12:45:11+00:00 heroku[web.1]: State changed from created to starting
2011-06-14T12:45:16+00:00 heroku[web.1]: Starting process with command: `thin -p 46054 -e production -R /home/heroku_rack/heroku.ru start`
2011-06-14T12:45:20+00:00 app[web.1]: (erb):9:in `rescue in <main>': Invalid DATABASE_URL (RuntimeError)
2011-06-14T12:45:20+00:00 app[web.1]:   from (erb):6:in `<main>'
2011-06-14T12:45:20+00:00 app[web.1]:   from /usr/ruby1.9.2/lib/ruby/1.9.1/erb.rb:753:in `eval'
2011-06-14T12:45:20+00:00 app[web.1]:   from /usr/ruby1.9.2/lib/ruby/1.9.1/erb.rb:753:in `result'
2011-06-14T12:45:20+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.1/lib/rails/application/configuration.rb:86:in `database_configuration'
2011-06-14T12:45:20+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/activerecord-3.0.1/lib/active_record/railtie.rb:58:in `block (2 levels) in <class:Railtie>'
2011-06-14T12:45:20+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.0.1/lib/active_support/lazy_load_hooks.rb:36:in `instance_eval'
2011-06-14T12:45:20+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.0.1/lib/active_support/lazy_load_hooks.rb:36:in `execute_hook'
2011-06-14T12:45:20+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.0.1/lib/active_support/lazy_load_hooks.rb:43:in `block in run_load_hooks'
2011-06-14T12:45:20+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.0.1/lib/active_support/lazy_load_hooks.rb:42:in `each'
2011-06-14T12:45:20+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.0.1/lib/active_support/lazy_load_hooks.rb:42:in `run_load_hooks'
2011-06-14T12:45:20+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/activerecord-3.0.1/lib/active_record/base.rb:1867:in `<top (required)>'
2011-06-14T12:45:20+00:00 app[web.1]:   from /app/app/models/user.rb:14:in `<top (required)>'
2011-06-14T12:45:20+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:239:in `require'
2011-06-14T12:45:20+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:239:in `block in require'
2011-06-14T12:45:20+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:227:in `load_dependency'
2011-06-14T12:45:20+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:239:in `require'
2011-06-14T12:45:20+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:346:in `require_or_load'
2011-06-14T12:45:20+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:300:in `depend_on'
2011-06-14T12:45:20+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:216:in `require_dependency'
2011-06-14T12:45:20+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.1/lib/rails/engine.rb:138:in `block (2 levels) in eager_load!'
2011-06-14T12:45:20+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.1/lib/rails/engine.rb:137:in `each'
2011-06-14T12:45:20+00:00 heroku[web.1]: Process exited
2011-06-14T12:45:21+00:00 heroku[web.1]: State changed from starting to crashed
2011-06-14T12:45:21+00:00 heroku[router]: Error H10 (App crashed) -> GET deep-beach-590.heroku.com/ dyno= queue= wait= service= bytes=
2011-06-14T05:45:21-07:00 heroku[nginx]: GET / HTTP/1.1 | 86.44.102.112 | 796 | http | 503
2011-06-14T12:45:21+00:00 heroku[router]: Error H10 (App crashed) -> GET deep-beach-590.heroku.com/favicon.ico dyno= queue= wait= service= bytes=

I think the simpler solution here might be to destroy the app and start again.

解决方案

Most likely you are missing the shared-database addon.

heroku addons:add shared-database

See https://devcenter.heroku.com/articles/database#troubleshooting

这篇关于Heroku应用程序崩溃,收到“Invalid DATABASE URL”当尝试heroku rake db:migrate的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆