Rails 4.1.0 and authlogic bcrypt issue
-
21-12-2019 - |
Question
I'm running the latest OSX with rvm ruby 2.1.0. After bundle update
to Rails 4.1.0 and authlogic 3.4.1, when I start the server I get this error:
authlogic/crypto_providers/bcrypt.rb:1:in `require': cannot load such file -- bcrypt (LoadError)
authlogic-3.4.1/lib/authlogic/crypto_providers/bcrypt.rb:1:in `<top (required)>'
authlogic-3.4.1/lib/authlogic.rb:60:in `require'
authlogic-3.4.1/lib/authlogic.rb:60:in `block in <top (required)>'
authlogic-3.4.1/lib/authlogic.rb:59:in `each'
authlogic-3.4.1/lib/authlogic.rb:59:in `<top (required)>'
bundler-1.5.2/lib/bundler/runtime.rb:76:in `require'
bundler-1.5.2/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
bundler-1.5.2/lib/bundler/runtime.rb:72:in `each'
bundler-1.5.2/lib/bundler/runtime.rb:72:in `block in require'
bundler-1.5.2/lib/bundler/runtime.rb:61:in `each'
bundler-1.5.2/lib/bundler/runtime.rb:61:in `require'
bundler-1.5.2/lib/bundler.rb:131:in `require'
application.rb:7:in `<top (required)>'
railties-4.1.0/lib/rails/commands/commands_tasks.rb:79:in `require'
railties-4.1.0/lib/rails/commands/commands_tasks.rb:79:in `block in server'
railties-4.1.0/lib/rails/commands/commands_tasks.rb:76:in `tap'
railties-4.1.0/lib/rails/commands/commands_tasks.rb:76:in `server'
railties-4.1.0/lib/rails/commands/commands_tasks.rb:40:in `run_command!'
railties-4.1.0/lib/rails/commands.rb:17:in `<top (required)>'
Solution
From this issue on the authlogic github account
Authlogic has changed its default encryption system from SHA512 to SCrypt.
It seems that you need this in your gemfile
gem 'authlogic', '~> 3.4.0'
gem 'scrypt'
If you don't want SCrypt you can use Sha512 by putting this
acts_as_authentic do |c|
c.crypto_provider = Authlogic::CryptoProviders::Sha512
end
in your User.rb
You also might need to specify the version of the authlogic gem
gem 'authlogic', github: 'binarylogic/authlogic', ref: 'e4b2990d6282f3f7b50249b4f639631aef68b939'
but I guess this will be fixed soon
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow