cannot load such file ― 1.9/bcrypt_ext (LoadError)

匿名 (未验证) 提交于 2019-12-03 01:31:01

问题:

Hey I get the following Error when i try to start the rails server

Any ideas? At the moment no possible solution worked...

By the way I run Windows 8... might be the problem at all :D

C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:251:in `require': cannot load such file -- 1.9/bcry pt_ext (LoadError)     from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:251:in `block in require'     from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:236:in `load_dependency'     from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:251:in `require'     from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bcrypt-ruby-3.1.0-x86-mingw32/lib/bcrypt_ext.rb:2:in `'     from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:251:in `require'     from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:251:in `block in require'     from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:236:in `load_dependency'     from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:251:in `require'     from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bcrypt-ruby-3.1.0-x86-mingw32/lib/bcrypt.rb:12:in `'     from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.3.4/lib/bundler/runtime.rb:72:in `require'     from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.3.4/lib/bundler/runtime.rb:72:in `block (2 levels) in require'     from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.3.4/lib/bundler/runtime.rb:70:in `each'     from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.3.4/lib/bundler/runtime.rb:70:in `block in require'     from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.3.4/lib/bundler/runtime.rb:59:in `each'     from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.3.4/lib/bundler/runtime.rb:59:in `require'     from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.3.4/lib/bundler.rb:132:in `require'     from C:/Users/Enno/RubymineProjects/BookWriting2.0/config/application.rb:13:in `'     from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.11/lib/rails/commands.rb:24:in `require'     from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.11/lib/rails/commands.rb:24:in `'     from script/rails:6:in `require'     from script/rails:6:in `
'

回答1:

This morning, I'm facing the same issue too (Windows 7). Let me recommend to have a look here https://github.com/codahale/bcrypt-ruby/issues/72

I successfully fix my problem like this (updating my Gemfile):

gem 'bcrypt-ruby', '3.1.1.rc1', :require => 'bcrypt'


回答2:

If you have problems with the gem bcrypt, follow these steps:

1. Change to the gem directory found by bundle show bcrypt + ext\mri\, for example: c:\RailsInstaller\Ruby2.2.3\lib\ruby\gems\2.2.0\gems\bcrypt-3.1.10-x86-mingw32\ext\mri

2. run ruby extconf.rb

3. run make

4. make install

Note that this works only if your DevKit environment is correctly setup (run devkitvars.bat).



回答3:

I encountered a similar issue but with Ruby 2.0 and Rails 3.2.15 on Windows. It now requires at least 3.1.2:

gem 'bcrypt-ruby', '~> 3.1.2'

Link: https://github.com/rails/rails/pull/12325



回答4:

Comment off "gem 'bcrypt-ruby', '~> 3.0.0'" in your gemfile this should be work



回答5:

The relevant version will constantly change. You can find the newest stable version number here: rubygems.org/gems/bcrypt-ruby



回答6:

If anyone is still having issues with this (especially with devise) on Windows 64 bit, try installing Ruby 64 bit, then rails as a gem (rather than using the rails installer) and then add: gem 'bcrypt-ruby', '~> 3.0.0', :require => "bcrypt"

You may need to change your tzinfo-data gem to: gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw]



易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!