1
有一個Ruby on Rails應用程序使用BCrypt哈希密碼,用戶模型使用Ruby Bcrypt與Heroku的
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安裝好。
任何想法,我可以去解決這個問題?我全力以赴!
謝謝
你試過要求bcrypt嗎? Heroku的文件系統區分大小寫。 – eugen
你真令人驚歎!我無法相信這是如此簡單的解決方法,有一天我的生活我不會回來!非常感謝,如果您將它作爲答案發布,我會將其標記爲正確。 – Ben