Rails 4.1.0和authlogic bcrypt问题

ant*_*paw 2 ruby ruby-on-rails bcrypt authlogic

我用rvm ruby​​ 2.1.0运行最新的OSX.在bundle updateRails 4.1.0和authlogic 3.4.1之后,当我启动服务器时出现此错误:

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)>'
Run Code Online (Sandbox Code Playgroud)

And*_*tad 7

从authlogic github帐户的这个问题

Authlogic已将其默认加密系统从SHA512更改为SCrypt.

看来你需要在你的gemfile中使用它

gem 'authlogic', '~> 3.4.0'
gem 'scrypt'
Run Code Online (Sandbox Code Playgroud)

如果您不想要SCrypt,可以使用Sha512

acts_as_authentic do |c|
  c.crypto_provider = Authlogic::CryptoProviders::Sha512
end
Run Code Online (Sandbox Code Playgroud)

在你的 User.rb

您还可能需要指定authlogic gem的版本

gem 'authlogic', github: 'binarylogic/authlogic', ref: 'e4b2990d6282f3f7b50249b4f639631aef68b939'
Run Code Online (Sandbox Code Playgroud)

但我想这很快就会解决