BCrypt を使用してパスワードをハッシュする Ruby on Rails アプリがあり、User モデルには
require "BCrypt"
そしてgemfileには
gem 'bcrypt-ruby'
これは、ローカルで実行している場合はすべて正常に機能しますが、Heroku サーバーにデプロイすると、次のエラーが発生します。
2012-11-16T14:42:32+00:00 app[web.1]: Exiting
2012-11-16T14:42:32+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.6/lib/rails/application/finisher.rb:53:in `block in <module:Finisher>'
2012-11-16T14:42:32+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.6/lib/rails/engine.rb:436:in `eager_load!'
2012-11-16T14:42:32+00:00 app[web.1]: => Ctrl-C to shutdown server
2012-11-16T14:42:32+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:312:in `depend_on'
2012-11-16T14:42:32+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:225:in `require_dependency'
2012-11-16T14:42:32+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:317:in `rescue in depend_on': No such file to load -- BCrypt (LoadError)
2012-11-16T14:42:32+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.6/lib/rails/engine.rb:439:in `block (2 levels) in eager_load!'
2012-11-16T14:42:32+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.6/lib/rails/initializable.rb:30:in `instance_exec'
...
2012-11-16T14:42:32+00:00 app[web.1]: from script/rails:6:in `<main>'
2012-11-16T14:42:33+00:00 heroku[web.1]: Process exited with status 1
2012-11-16T14:42:33+00:00 heroku[web.1]: State changed from crashed to down
2012-11-16T14:42:33+00:00 heroku[web.1]: State changed from starting to crashed
2012-11-16T14:42:34+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/ host=smartaprofiles.herokuapp.com fwd= dyno= queue= wait= connect= service= status=503 bytes=
私は問題を想定していますが、No such file to load -- BCrypt (LoadError)
それを修正することはできず、正常bundle install
に動作し、 bundle update
bcrypt-ruby は正常にインストールされていると表示されます。
これを修正する方法はありますか?私は全力です!
ありがとう