我正在使用ruby 2.2.4。我在安装Devise gem之后尝试注册时出现此错误。我曾经使用过ruby 2.1.5时从未遇到过这个错误。 ruby版本是错误的原因吗?
更新:这是我的gemfile看起来像我正在使用Windows 7 Professional 64位
source 'https://rubygems.org'
gem 'rails', '4.2.5.1'
gem 'sqlite3'
gem 'sass-rails', '~> 5.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.1.0'
gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder', '~> 2.0'
gem 'simple_form', '~> 3.2', '>= 3.2.1'
gem 'country_select', '~> 2.5', '>= 2.5.1'
gem 'devise', '~> 3.5', '>= 3.5.6'
group :doc do
gem 'sdoc', '~> 0.4.0'
end
group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug'
end
group :development do
# Access an IRB console on exception pages or by using <%= console %> in views
gem 'web-console', '~> 2.0'
end
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
答案 0 :(得分:1)
设计3.5.6需要bcrypt&lt; = 3.0,你可能有,但是在Windows上特定版本的Ruby不支持某些版本的bcrypt,这可能是你所看到的。
这是我在bcrypt github repo:
上挖掘的内容1) Launch a terminal session
2) Enter gem uninstall bcrypt
3) Enter gem uninstall bcrypt-ruby
4) Enter gem install bcrypt --platform=ruby
5) Edit your gemfile to include the following line:
gem 'bcrypt-ruby', '3.1.5', :require => 'bcrypt'
6) Run bundle install