【问题标题】:Heroku Crashed Application ErrorHeroku 崩溃的应用程序错误
【发布时间】:2013-06-26 01:48:01
【问题描述】:

我在 heroku 上的应用程序出现应用程序错误。 这是日志:

2013-06-26T01:11:29.361666+00:00 app[web.1]: DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /app/config/environment.rb:5)
2013-06-26T01:11:29.361401+00:00 app[web.1]: DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /app/config/environment.rb:5)
2013-06-26T01:11:32.327019+00:00 app[web.1]: => Booting WEBrick
2013-06-26T01:11:32.327019+00:00 app[web.1]: => Rails 3.2.13 application starting in production on http://0.0.0.0:53357
2013-06-26T01:11:32.327019+00:00 app[web.1]: => Call with -d to detach
2013-06-26T01:11:32.327019+00:00 app[web.1]: => Ctrl-C to shutdown server
2013-06-26T01:11:32.327019+00:00 app[web.1]: Exiting
2013-06-26T01:11:32.327988+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require': cannot load such file -- devise/orm/active_record (LoadError)
2013-06-26T01:11:32.327988+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency'
2013-06-26T01:11:32.327988+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `block in require'
2013-06-26T01:11:32.327988+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
2013-06-26T01:11:32.327988+00:00 app[web.1]:    from /app/config/initializers/devise.rb:1:in `<top (required)>'
2013-06-26T01:11:32.327988+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:245:in `load'
2013-06-26T01:11:32.327988+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:245:in `block in load'
2013-06-26T01:11:32.327988+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency'
2013-06-26T01:11:32.327988+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:245:in `load'
2013-06-26T01:11:32.328166+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/engine.rb:587:in `each'
2013-06-26T01:11:32.328166+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/engine.rb:587:in `block in <class:Engine>'
2013-06-26T01:11:32.327988+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/engine.rb:588:in `block (2 levels) in <class:Engine>'
2013-06-26T01:11:32.328166+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/initializable.rb:30:in `instance_exec'
2013-06-26T01:11:32.328166+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/initializable.rb:30:in `run'
2013-06-26T01:11:32.328166+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/initializable.rb:54:in `each'
2013-06-26T01:11:32.328166+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/initializable.rb:55:in `block in run_initializers'
2013-06-26T01:11:32.328166+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/initializable.rb:54:in `run_initializers'
2013-06-26T01:11:32.328166+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/railtie/configurable.rb:30:in `method_missing'
2013-06-26T01:11:32.328166+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/application.rb:136:in `initialize!'
2013-06-26T01:11:32.328166+00:00 app[web.1]:    from /app/config/environment.rb:5:in `<top (required)>'
2013-06-26T01:11:32.328337+00:00 app[web.1]:    from /app/config.ru:3:in `require'
2013-06-26T01:11:32.328337+00:00 app[web.1]:    from /app/config.ru:3:in `block in <main>'
2013-06-26T01:11:32.328337+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/builder.rb:51:in `instance_eval'
2013-06-26T01:11:32.328337+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/builder.rb:51:in `initialize'
2013-06-26T01:11:32.328337+00:00 app[web.1]:    from /app/config.ru:in `new'
2013-06-26T01:11:32.328337+00:00 app[web.1]:    from /app/config.ru:in `<main>'
2013-06-26T01:11:32.328337+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/builder.rb:40:in `eval'
2013-06-26T01:11:32.328337+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/builder.rb:40:in `parse_file'
2013-06-26T01:11:32.328337+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/server.rb:200:in `app'
2013-06-26T01:11:32.328337+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/commands/server.rb:46:in `app'
2013-06-26T01:11:32.328770+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/server.rb:304:in `wrapped_app'
2013-06-26T01:11:32.328770+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/server.rb:254:in `start'
2013-06-26T01:11:32.328770+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/commands/server.rb:70:in `start'
2013-06-26T01:11:32.328770+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/commands.rb:55:in `block in <top (required)>'
2013-06-26T01:11:32.328770+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/commands.rb:50:in `tap'
2013-06-26T01:11:32.328770+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/commands.rb:50:in `<top (required)>'
2013-06-26T01:11:32.328770+00:00 app[web.1]:    from script/rails:6:in `require'
2013-06-26T01:11:32.328770+00:00 app[web.1]:    from script/rails:6:in `<main>'
2013-06-26T01:11:33.739784+00:00 heroku[web.1]: State changed from starting to crashed
2013-06-26T01:11:33.737535+00:00 heroku[web.1]: Process exited with status 1
2013-06-26T01:13:34.565799+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/ host=cuica.herokuapp.com fwd="177.158.207.226" dyno= connect= service= status=503 bytes=
2013-06-26T01:13:35.001732+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/favicon.ico host=cuica.herokuapp.com fwd="177.158.207.226" dyno= connect= service= status=503 bytes=

这是我的 gemfile:

source 'https://rubygems.org'
ruby '1.9.3'

gem 'rails', '3.2.13'
gem 'jquery-rails', '2.0.2'
gem 'haml-rails'
gem 'bcrypt-ruby', '~> 3.0.0'

group :development, :test do
  gem 'sqlite3', '1.3.5'
  gem 'rspec-rails', '2.11.0'
end

group :development do
  gem 'better_errors'
  gem 'binding_of_caller'
end

group :assets do
  gem 'sass-rails',   '3.2.5'
  gem 'coffee-rails', '3.2.2'
  gem 'uglifier', '1.2.3'
  gem 'zurb-foundation', '~> 4.0.0'
end

group :test do
  gem 'capybara', '1.1.2'
end

group :production do
  gem 'pg'
end

我不知道该怎么办。我搜索但没有找到一些 gem 来改善日志错误,例如本地的 better_erros gem。有没有类似的宝石?无论如何,我需要解决这个大问题! 请给我光! 谢谢!

【问题讨论】:

    标签: ruby-on-rails ruby logging heroku


    【解决方案1】:

    发生的情况是,当您的应用程序在生产模式下运行时,它不会响应“设计”方法。这通常意味着您尚未加载 ORM 文件或加载得太晚。要修复它,请务必在 'config/initializers/devise.rb' 内或在 'config/application.rb' (RuntimeError) 中的应用程序定义之前添加 require 'devise/orm/active_record'

    所以你的devise.rb应该有以下内容

    # ==> ORM configuration
      # Load and configure the ORM. Supports :active_record (default) and
      # :mongoid (bson_ext recommended) by default. Other ORMs may be
      # available as additional gems.
      require 'devise/orm/active_record'
    

    只有我一个人。我相信我在您的 gemfile 中看不到 gem 'devise' !难怪这可能会引发错误。

    【讨论】:

    • 天哪!我删除了设计及其依赖项(或者至少我相信)。我不再使用它,我该如何彻底清除他的遗体?
    • 您可以同时执行两个gem uninstall devise,然后您可以执行gem cleanup。您可以通过 gem dependency devise 列出依赖项,这将列出您的依赖项,并且您可以计算出需要删除的内容。当您重新添加设计时,我建议在您的 gemfile gem 'devise', :git =&gt; 'https://github.com/plataformatec/devise.git' 中添加以下内容
    • 天哪,是说我没有 rvm/gems 目录的写权限!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-08-20
    • 2012-06-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多