无法加载此类文件 – 1.9 / bcrypt_ext(LoadError)

嘿,当我尝试启动rails服务器时,我得到以下错误

有任何想法吗? 目前还没有可行的解决方案……

顺便说一句,我运行Windows 8 ……可能是问题所在: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 `' 

今天早上,我也面临同样的问题(Windows 7)。 让我建议看看这里https://github.com/codahale/bcrypt-ruby/issues/72

我成功解决了这个问题(更新我的Gemfile):

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

如果您对gem bcrypt有问题,请按照下列步骤操作:

1.更改为bundle show bcrypt + ext\mri\找到的gem目录,例如: c:\RailsInstaller\Ruby2.2.3\lib\ruby\gems\2.2.0\gems\bcrypt-3.1.10-x86-mingw32\ext\mri

2.运行ruby extconf.rb

3.运行make

4. make install

请注意,只有正确设置了DevKit环境(运行devkitvars.bat ), devkitvars.bat

我遇到了类似的问题,但在Windows上使用Ruby 2.0和Rails 3.2.15。 它现在至少需要3.1.2:

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

链接: https : //github.com/rails/rails/pull/12325

在你的gemfile中评论“gem’bcrypt-ruby’,’〜> 3.0.0’”,这应该是有用的

相关版本将不断变化。 你可以在这里找到最新的稳定版本号:rubygems.org/gems/bcrypt-ruby

如果有人在Windows 64位上仍然遇到此问题(特别是使用设计),请尝试安装Ruby 64位,然后将rails作为gem(而不是使用rails安装程序),然后添加: gem 'bcrypt-ruby', '~> 3.0.0', :require => "bcrypt"

您可能需要将tzinfo-data gem更改为: gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw]