【发布时间】:2017-04-17 23:38:00
【问题描述】:
我正在使用 devise 的 gem,但在 Devise::RegistrationsController#create 中出现错误 LoadError 无法加载此类文件 -- bcrypt_ext .. 我尝试对此问题进行一些研究,并尝试按照给出的说明进行操作(https://stackoverflow.com/questions/35422463/loaderror-in-deviseregistrationscontrollercreate-cannot-load-such-file-bc)
但还是有这个问题。有什么建议吗?
注意:我使用的指南是 video guide,我在 Windows 7 上使用 ruby on rails
宝石文件
source 'https://rubygems.org'
git_source(:github) do |repo_name|
repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
"https://github.com/#{repo_name}.git"
end
# error in devise
gem 'bcrypt-ruby', '~> 3.1', '>= 3.1.5'
# Bundle for authentication
gem 'devise', '~> 4.2', '>= 4.2.1'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.1.0.rc1'
# Use postgresql as the database for Active Record
gem 'pg', '~> 0.18'
# Use Puma as the app server
gem 'puma', '~> 3.7'
# Use SCSS for stylesheets
gem 'sass-rails', github: "rails/sass-rails"
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.2'
# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
gem 'turbolinks', '~> 5'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.5'
# Use Redis adapter to run Action Cable in production
# gem 'redis', '~> 3.0'
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'
# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development
group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
# Adds support for Capybara system testing and selenium driver
gem 'capybara', '~> 2.13.0'
gem 'selenium-webdriver'
end
group :development do
# Access an IRB console on exception pages or by using <%= console %> anywhere in the code.
gem 'web-console', '>= 3.3.0'
end
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
【问题讨论】:
-
取消注释
# gem 'bcrypt', '~> 3.1.7'并运行bundle install -
我检查了我的 gem,它现在被列出 bcrypt (3.1.11 ruby x86-mingw32) bcrypt-ruby (3.1.5 x86-mingw32) 我也重新启动了 serverf
-
Wups,现在我无法运行 rails 服务器,因为它给了我这个错误“C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-5.1. 0.rc1/lib/active_support/dependencies.rb:292:in `require': cannot load such file -- bcrypt_ext (LoadError) "
-
@Angel 这可能会有所帮助stackoverflow.com/questions/33588735/…
标签: ruby-on-rails windows devise