Windows 上的 Ruby 导致错误无法加载此类文件 bcrypt_ext [英] Ruby on windows causes error Cannot load such file bcrypt_ext
问题描述
每当我转到 rails s 或 rake db:migrate 时,尝试在我的 Windows 7 机器上运行 ruby 我收到以下错误无法加载此类文件 bcrypt_ext.
Trying to run ruby on my Windows 7 machine whenever i go to rails s or rake db:migrate i get the following error Cannot load such file bcrypt_ext.
我的 ruby 版本是 2.2.1,我的 rails 版本是 4.2.0,bcrypt 版本是 3.1.10.当我运行 bundle install 时,所有 gems 都安装正确,但是每当我尝试 rake 时,它都会给我这个错误.任何帮助将不胜感激
My ruby version is 2.2.1 my rails version is 4.2.0 and the bcrypt version is 3.1.10. All the gems install correctly when i run bundle install however whenever i try to rake it gives me that error. Any help would be greatly appreciated
推荐答案
你需要使用这里所说的:https://www.alib.jp/entries/bcrypt_ext_load_error_on_ruby21x
You need to use what it says here: https://www.alib.jp/entries/bcrypt_ext_load_error_on_ruby21x
C:\> gem install --no-ri --no-rdoc bcrypt
C:\> cd (path to gems root)\bcrypt-3.1.7-x86-mingw32\ext\mri
C:\(path to gems root)\bcrypt-3.1.7-x86-mingw32\ext\mri> ruby extconf.rb
C:\(path to gems root)\bcrypt-3.1.7-x86-mingw32\ext\mri> make
C:\(path to gems root)\bcrypt-3.1.7-x86-mingw32\ext\mri> make install
这篇关于Windows 上的 Ruby 导致错误无法加载此类文件 bcrypt_ext的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!