1

自从我上次尝试访问我的应用程序时对 heroku 进行提交以来,我一直收到此错误“应用程序中发生错误,无法提供您的页面。请稍后再试。

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

所以我运行 heroku logs 命令,我无法理解日志错误。我最了解的是 bcrypt gem 有问题,但我不确定是什么。任何帮助/解决方案将不胜感激,谢谢。

$ heroku logs
←[36m2013-07-06T17:18:26.969966+00:00 app[web.1]:←[0m   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/initializable.rb:54:in `run_initializers'
←[36m2013-07-06T17:18:26.969771+00:00 app[web.1]:←[0m   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/initializable.rb:55:in `block in run_initializers'
←[36m2013-07-06T17:18:26.969966+00:00 app[web.1]:←[0m   from config.ru:3:in `block in <main>'
←[36m2013-07-06T17:18:26.970385+00:00 app[web.1]:←[0m   from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.5.1/lib/rack/adapter/loader.rb:33:in `eval'
←[36m2013-07-06T17:18:26.970385+00:00 app[web.1]:←[0m   from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.5.1/lib/rack/adapter/loader.rb:33:in `load'
←[36m2013-07-06T17:18:26.970385+00:00 app[web.1]:←[0m   from config.ru:1:in `<main>'
←[36m2013-07-06T17:18:26.970385+00:00 app[web.1]:←[0m   from /app/vendor/bundle/ruby/1.9.1/bin/thin:23:in `<main>'
←[36m2013-07-06T17:18:26.969966+00:00 app[web.1]:←[0m   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/initializable.rb:54:in `each'
←[36m2013-07-06T17:18:26.969966+00:00 app[web.1]:←[0m   from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/builder.rb:51:in `instance_eval'
←[36m2013-07-06T17:18:26.970385+00:00 app[web.1]:←[0m   from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.5.1/bin/thin:6:in `<top (required)>'
←[36m2013-07-06T17:18:26.969966+00:00 app[web.1]:←[0m   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/railtie/configurable.rb:30:in `method_missing'
←[36m2013-07-06T17:18:26.969966+00:00 app[web.1]:←[0m   from config.ru:3:in `require'
←[36m2013-07-06T17:18:26.970385+00:00 app[web.1]:←[0m   from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.5.1/lib/thin/controllers/controller.rb:181:in `load_rackup_config'
←[36m2013-07-06T17:18:26.970385+00:00 app[web.1]:←[0m   from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.5.1/lib/thin/controllers/controller.rb:71:in `start'
←[36m2013-07-06T17:18:26.970385+00:00 app[web.1]:←[0m   from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.5.1/lib/thin/runner.rb:187:in `run_command'
←[36m2013-07-06T17:18:26.969966+00:00 app[web.1]:←[0m   from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/builder.rb:51:in `initialize'
←[36m2013-07-06T17:18:26.969966+00:00 app[web.1]:←[0m   from config.ru:1:in `new'
←[36m2013-07-06T17:18:26.970385+00:00 app[web.1]:←[0m   from /app/vendor/bundle/ruby/1.9.1/bin/thin:23:in `load'
←[36m2013-07-06T17:18:28.491595+00:00 heroku[web.1]:←[0m Process exited with status 1
←[36m2013-07-06T17:18:28.500515+00:00 heroku[web.1]:←[0m State changed from starting to crashed
2013-07-06T17:21:11+00:00 heroku[slug-compiler]: Slug compilation started
←[33m2013-07-06T17:23:02.480186+00:00 heroku[api]:←[0m Deploy 9e263bb by blank@gmail.com
←[33m2013-07-06T17:23:02.502453+00:00 heroku[api]:←[0m Release v135 created by blank@gmail.com
←[33m2013-07-06T17:23:02.542045+00:00 heroku[api]:←[0m Deploy 9e263bb by blank@gmail.com
←[36m2013-07-06T17:23:02.621820+00:00 heroku[web.1]:←[0m State changed from crashed to starting
2013-07-06T17:23:03+00:00 heroku[slug-compiler]: Slug compilation finished
←[36m2013-07-06T17:23:08.258293+00:00 heroku[web.1]:←[0m Starting process with command `bundle exec thin start -R config.ru -e $RAILS_ENV -p 58707`
←[36m2013-07-06T17:23:16.272833+00:00 app[web.1]:←[0m 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)
←[36m2013-07-06T17:23:16.273194+00:00 app[web.1]:←[0m 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)
←[36m2013-07-06T17:23:21.753335+00:00 app[web.1]:←[0m
←[36m2013-07-06T17:23:21.753335+00:00 app[web.1]:←[0m  Called from: /app/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.8/lib/action_dispatch/middleware/session/abstract_store.rb:28:
in `initialize'.
←[36m2013-07-06T17:23:21.753335+00:00 app[web.1]:←[0m
←[36m2013-07-06T17:23:26.052416+00:00 app[web.1]:←[0m Connecting to database specified by DATABASE_URL
←[36m2013-07-06T17:23:26.533047+00:00 app[web.1]:←[0m /app/vendor/bundle/ruby/1.9.1/gems/bundler-1.3.2/lib/bundler/rubygems_integration.rb:224:in `block in replace_gem': can't activate bc
rypt-ruby (~> 3.0.0), already activated bcrypt-ruby-3.1.0. Make sure all dependencies are added to Gemfile. (Gem::LoadError)
←[36m2013-07-06T17:23:26.534901+00:00 app[web.1]:←[0m   from /app/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.8/lib/action_controller/metal/params_wrapper.rb:133:in `inherited'
←[36m2013-07-06T17:23:26.533047+00:00 app[web.1]:←[0m   from /app/vendor/bundle/ruby/1.9.1/gems/activemodel-3.2.8/lib/active_model/secure_password.rb:37:in `has_secure_password'
←[36m2013-07-06T17:23:26.533047+00:00 app[web.1]:←[0m   from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:251:in `require'
←[36m2013-07-06T17:23:26.533047+00:00 app[web.1]:←[0m   from /app/app/models/member.rb:1:in `<top (required)>'
←[36m2013-07-06T17:23:26.533679+00:00 app[web.1]:←[0m   from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:192:in `block in const_missing'
←[36m2013-07-06T17:23:26.534559+00:00 app[web.1]:←[0m   from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.8/lib/active_support/inflector/methods.rb:260:in `safe_constantize'
←[36m2013-07-06T17:23:26.533565+00:00 app[web.1]:←[0m   from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:502:in `load_missing_constant'
←[36m2013-07-06T17:23:26.534019+00:00 app[web.1]:←[0m   from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:190:in `const_missing'
←[36m2013-07-06T17:23:26.534443+00:00 app[web.1]:←[0m   from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.8/lib/active_support/inflector/methods.rb:229:in `constantize'
←[36m2013-07-06T17:23:26.535034+00:00 app[web.1]:←[0m   from /app/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.8/lib/abstract_controller/railties/routes_helpers.rb:7:in `block (2 levels)
in with'
←[36m2013-07-06T17:23:26.533047+00:00 app[web.1]:←[0m   from /app/app/models/member.rb:4:in `<class:Member>'
←[36m2013-07-06T17:23:26.533047+00:00 app[web.1]:←[0m   from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:236:in `load_dependency'
←[36m2013-07-06T17:23:26.534224+00:00 app[web.1]:←[0m   from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.8/lib/active_support/inflector/methods.rb:230:in `block in constantize'
←[36m2013-07-06T17:23:26.533047+00:00 app[web.1]:←[0m   from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:251:in `block in require'
←[36m2013-07-06T17:23:26.533413+00:00 app[web.1]:←[0m   from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:251:in `require'
←[36m2013-07-06T17:23:26.534332+00:00 app[web.1]:←[0m   from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.8/lib/active_support/inflector/methods.rb:229:in `each'
←[36m2013-07-06T17:23:26.533413+00:00 app[web.1]:←[0m   from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:359:in `require_or_load'
←[36m2013-07-06T17:23:26.533921+00:00 app[web.1]:←[0m   from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:190:in `each'
←[36m2013-07-06T17:23:26.535192+00:00 app[web.1]:←[0m   from /app/app/controllers/members_controller.rb:1:in `<top (required)>'
←[36m2013-07-06T17:23:26.538409+00:00 app[web.1]:←[0m   from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:251:in `block in require'
←[36m2013-07-06T17:23:26.534559+00:00 app[web.1]:←[0m   from /app/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.8/lib/action_controller/metal/params_wrapper.rb:152:in `_default_wrap_model'
←[36m2013-07-06T17:23:26.534787+00:00 app[web.1]:←[0m   from /app/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.8/lib/action_controller/metal/params_wrapper.rb:169:in `_set_wrapper_default
s'
←[36m2013-07-06T17:23:26.538409+00:00 app[web.1]:←[0m   from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:251:in `require'
←[36m2013-07-06T17:23:26.538514+00:00 app[web.1]:←[0m   from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:225:in `require_dependency'
←[36m2013-07-06T17:23:26.538646+00:00 app[web.1]:←[0m   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/engine.rb:438:in `each'
←[36m2013-07-06T17:23:26.534559+00:00 app[web.1]:←[0m   from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.8/lib/active_support/core_ext/string/inflections.rb:66:in `safe_constanti
ze'
←[36m2013-07-06T17:23:26.535135+00:00 app[web.1]:←[0m   from /app/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.8/lib/action_controller/railties/paths.rb:7:in `block (2 levels) in with'
←[36m2013-07-06T17:23:26.538409+00:00 app[web.1]:←[0m   from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:359:in `require_or_load'
←[36m2013-07-06T17:23:26.538646+00:00 app[web.1]:←[0m   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/engine.rb:438:in `block in eager_load!'
←[36m2013-07-06T17:23:26.538409+00:00 app[web.1]:←[0m   from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:236:in `load_dependency'
←[36m2013-07-06T17:23:26.538514+00:00 app[web.1]:←[0m   from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:313:in `depend_on'
←[36m2013-07-06T17:23:26.542055+00:00 app[web.1]:←[0m   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/railtie/configurable.rb:30:in `method_missing'
←[36m2013-07-06T17:23:26.542152+00:00 app[web.1]:←[0m   from config.ru:1:in `new'
←[36m2013-07-06T17:23:26.541993+00:00 app[web.1]:←[0m   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/initializable.rb:54:in `each'
←[36m2013-07-06T17:23:26.542152+00:00 app[web.1]:←[0m   from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/builder.rb:51:in `instance_eval'
←[36m2013-07-06T17:23:26.541767+00:00 app[web.1]:←[0m   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/application/finisher.rb:53:in `block in <module:Finisher>'
←[36m2013-07-06T17:23:26.541993+00:00 app[web.1]:←[0m   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/initializable.rb:55:in `block in run_initializers'
←[36m2013-07-06T17:23:26.542152+00:00 app[web.1]:←[0m   from config.ru:3:in `block in <main>'
←[36m2013-07-06T17:23:26.538646+00:00 app[web.1]:←[0m   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/engine.rb:436:in `eager_load!'
←[36m2013-07-06T17:23:26.538409+00:00 app[web.1]:←[0m   from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:251:in `require'
←[36m2013-07-06T17:23:26.538646+00:00 app[web.1]:←[0m   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/engine.rb:436:in `each'
←[36m2013-07-06T17:23:26.541767+00:00 app[web.1]:←[0m   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/initializable.rb:30:in `instance_exec'
←[36m2013-07-06T17:23:26.541993+00:00 app[web.1]:←[0m   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/initializable.rb:54:in `run_initializers'
←[36m2013-07-06T17:23:26.542055+00:00 app[web.1]:←[0m   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/application.rb:136:in `initialize!'
←[36m2013-07-06T17:23:26.542152+00:00 app[web.1]:←[0m   from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/builder.rb:51:in `initialize'
←[36m2013-07-06T17:23:26.541890+00:00 app[web.1]:←[0m   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/initializable.rb:30:in `run'
←[36m2013-07-06T17:23:26.542152+00:00 app[web.1]:←[0m   from config.ru:3:in `require'
←[36m2013-07-06T17:23:26.538646+00:00 app[web.1]:←[0m   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/engine.rb:439:in `block (2 levels) in eager_load!'
←[36m2013-07-06T17:23:26.542152+00:00 app[web.1]:←[0m   from /app/config/environment.rb:5:in `<top (required)>'
←[36m2013-07-06T17:23:26.542437+00:00 app[web.1]:←[0m   from /app/vendor/bundle/ruby/1.9.1/bin/thin:23:in `<main>'
←[36m2013-07-06T17:23:26.542152+00:00 app[web.1]:←[0m   from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.5.1/lib/rack/adapter/loader.rb:33:in `eval'
←[36m2013-07-06T17:23:26.542437+00:00 app[web.1]:←[0m   from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.5.1/lib/thin/runner.rb:152:in `run!'
←[36m2013-07-06T17:23:26.542152+00:00 app[web.1]:←[0m   from config.ru:1:in `<main>'
←[36m2013-07-06T17:23:26.542437+00:00 app[web.1]:←[0m   from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.5.1/lib/thin/runner.rb:187:in `run_command'
←[36m2013-07-06T17:23:26.542304+00:00 app[web.1]:←[0m   from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.5.1/lib/thin/controllers/controller.rb:181:in `load_rackup_config'
←[36m2013-07-06T17:23:26.542152+00:00 app[web.1]:←[0m   from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.5.1/lib/rack/adapter/loader.rb:33:in `load'
←[36m2013-07-06T17:23:26.542304+00:00 app[web.1]:←[0m   from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.5.1/lib/thin/controllers/controller.rb:71:in `start'
←[36m2013-07-06T17:23:26.542437+00:00 app[web.1]:←[0m   from /app/vendor/bundle/ruby/1.9.1/bin/thin:23:in `load'
←[36m2013-07-06T17:23:26.542437+00:00 app[web.1]:←[0m   from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.5.1/bin/thin:6:in `<top (required)>'
←[36m2013-07-06T17:23:27.988495+00:00 heroku[web.1]:←[0m Process exited with status 1
←[36m2013-07-06T17:23:28.000207+00:00 heroku[web.1]:←[0m State changed from starting to crashed
←[32m2013-07-06T17:23:28.664077+00:00 heroku[router]:←[0m at=error code=H10 desc="App crashed" method=GET path=/ host=paradisedkp.herokuapp.com fwd="69.43.65.182" dyno= connect= service=
status=503 bytes=

宝石文件

source 'http://rubygems.org'

ruby '1.9.3'
gem 'json', '1.7.7'
gem 'rails', '3.2.8'

group :development, :test do
  gem 'mysql2'
end
group :production do
  gem 'pg'
  gem 'thin'
end

# Gems used only for assets and not required
# in production environments by default.
group :assets do
  gem 'sass-rails',   '~> 3.2.3'
  gem 'coffee-rails', '~> 3.2.1'

  # See https://github.com/sstephenson/execjs#readme for more supported runtimes
  # gem 'therubyracer', :platforms => :ruby

  gem 'uglifier', '>= 1.0.3'
end

gem 'jquery-rails'
gem 'heroku'
gem 'bcrypt-ruby', '~> 3.1.0'
gem 'mail'
gem 'will_paginate', '~> 3.0.0'
gem 'rufus-scheduler'
gem 'rails_autolink'
4

3 回答 3

2

很难阅读,但我认为关键是这一行:

can't activate bcrypt-ruby (~> 3.0.0), already activated bcrypt-ruby-3.1.0. Make sure all dependencies are added to Gemfile. (Gem::LoadError)

尝试添加它,然后重新部署。

编辑:

将此行添加到您的 Gemfile:

gem 'bcrypt-ruby', '~> 3.1.0'

然后运行bundle update bcrypt-ruby;git 添加 Gemfile 和 Gemfile.lock 并尝试重新部署;

于 2013-07-06T18:28:45.737 回答
0

当您的问题发布时(2013 年 7 月 6 日)Railssecure_password.rb正在使用gem 'bcrypt-ruby', '~> 3.0.0'

2013 年 7 月 17 日,Railssecure_password.rb更新为使用gem 'bcrypt-ruby', '~> 3.1.0'

见提交:https ://github.com/rails/rails/commit/ad62cf68f89506b0a5074fec8e08d104865aa0ee#L1L47

gem 'bcrypt-ruby', '~> 3.1.0'GemfileHeroku 使用包含上述提交的 Rails 版本之前,我认为您不能使用。

解决您的问题:
gem 'bcrypt-ruby', '~> 3.0.0'您的Gemfile.
然后bundle install更新你的Gemfile.lock.
然后git add .git commit -m "Using gem bcrypt-ruby ~> 3.0.0"
最后git push heroku master

于 2013-07-21T14:52:46.567 回答
0

你没疯 - 我遇到了同样的错误,并且能够通过在我的 Gemfile 中替换为来让事情正常gem 'bcrypt-ruby'进行gem 'bcrypt-ruby', '~> 3.0.0'

似乎某事,某处正在指定bcrypt-ruby (~> 3.0.0)-不知道是什么...

于 2013-07-08T20:58:21.217 回答