问题描述
当我尝试运行我的应用程序时,我不断收到此错误:
C:/ruby-2.0.0-p195-i386-mingw32/lib/ruby/ gems / 2.0.0 / gems / activesupport-4.0.0.rc1
/lib/active_support/dependencies.rb:228:in`require':无法加载这样的文件 - 2
.0 / bcrypt_ext (LoadError)
任何人? - 我尝试使用devise gem进行基本用户身份验证。
当我更新到Ruby时,我收到了这个错误Windows上为2.0.0+。我可以通过卸载下载的所有版本的bcrypt 并使用DevKit构建宝石来解决这个问题。
gem uninstall bcrypt-ruby
pre>
gem install bcrypt-ruby --platform = ruby --no-ri --no-rdoc
通常做一个
软件包更新
将下载一个预编译的gemmingw32
extension,在这种情况下看起来不起作用。重新安装bcrypt-ruby的这个解决方法有望在将来不再需要。
此外,我在这里保持Ruby on Rails的更新Windows安装说明(主要是为了我自己的参考)用于在Windows上安装Ruby on Rails。
您可能遇到的其他一些Windows陷阱也列在那里:
I keep getting this error when i try to run my app:
C:/ruby-2.0.0-p195-i386-mingw32/lib/ruby/gems/2.0.0/gems/activesupport-4.0.0.rc1 /lib/active_support/dependencies.rb:228:in `require': cannot load such file -- 2 .0/bcrypt_ext (LoadError)
Any takers? - im trying to use the devise gem for basic user authentication..
解决方案I've gotten this error when I updated to Ruby 2.0.0+ on Windows. I was able to solve it by uninstalling all versions of bcrypt that were downloaded, and building the gem using DevKit.
gem uninstall bcrypt-ruby gem install bcrypt-ruby --platform=ruby --no-ri --no-rdoc
Usually doing a
bundle update
will download a precompiled gemmingw32
extension, which in this case appears not to work. This workaround for reinstalling bcrypt-ruby will hopefully not be needed in the future.Additionally, I keep updated Windows installation instructions for Ruby on Rails here (mostly for my own reference) for installing Ruby on Rails on Windows.
https://github.com/remomueller/documentation/tree/master/windows
Some other Windows pitfalls you may run into are also listed there:
https://github.com/remomueller/documentation/blob/master/windows/190-miscellaneous.md
这篇关于bcrypt错误:Devy ruby 2.0和rails 4.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!