0

我在 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=

这是我的宝石文件:

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。有没有类似的宝石?无论如何,我需要解决这个大问题!请给我光!谢谢!

4

1 回答 1

0

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

所以你应该在你的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'

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

于 2013-06-26T02:06:55.853 回答