Devise :: RegistrationsController#create中的LoadError(无法加载此类文件-bcrypt_ext)。为什么会出现此错误? [英] LoadError in Devise::RegistrationsController#create (cannot load such file -- bcrypt_ext). Why do I get this error?

查看:45
本文介绍了Devise :: RegistrationsController#create中的LoadError(无法加载此类文件-bcrypt_ext)。为什么会出现此错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用ruby 2.2.4。安装Devise gem后尝试注册时出现此错误。我以前使用ruby 2.1.5时从未遇到此错误。红宝石版本是导致错误的原因吗?

I'm using ruby 2.2.4. I get this error when I tried to sign up after installing the Devise gem. I never experienced this error when I used to use ruby 2.1.5. Is the ruby version the cause of the error here?

更新:这是我的gemfile的样子,我使用的是Windows 7 Professional 64位

UPDATE: this is what my gemfile looks like and I'm using Windows 7 Professional 64-bit

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]


推荐答案

Devise 3.5.6需要bcrypt< = 3.0,您可能已经拥有了,但是某些版本的bcrypt在Windows上的特定版本的Ruby中不受支持。

Devise 3.5.6 needs bcrypt <= 3.0, which you probably have, but some versions of bcrypt were not supported with specific versions of Ruby on Windows, which is probably what you're seeing.

这就是我在 bcrypt github存储库中找到的内容:

This is what I dug up on the 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

这篇关于Devise :: RegistrationsController#create中的LoadError(无法加载此类文件-bcrypt_ext)。为什么会出现此错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆