在Windows上使用bcrypt 3.0.1与ruby2.0的问题 [英] Issues using bcrypt 3.0.1 with ruby2.0 on Windows

查看:144
本文介绍了在Windows上使用bcrypt 3.0.1与ruby2.0的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有人在Windows 8上安装bcrypt 3.0.1或3.1.2有任何问题?我试过测试不同的版本,但我得到这个错误。

但运行rails server后出现此错误。
无法加载这样的文件 - 2.0 / bcrypt_ext
您的应用程序中没有安装bcrypt-ruby,请将其添加到您的gem文件中并运行软件包安装程序。



我使用的是:
操作系统:Windows 8
Rails 4.0.0
Ruby 2.0.0
bcrypt-ruby 3.0.1



我的gemsfile已将bcrypt定义为此。
gem'bcrypt-ruby','3.0.1'



当我卸载3.0.1并安装3.1.2时,将我的gemfile更新为3.1 .2,运行bundle install,然后运行rails server,出现错误:

无法激活bcrypt-ruby(〜> 3.0.0),已经激活3.1.2 ...确保所有依赖关系都添加到gemfile中。



我试着做一个包更新,以使我获得所有的依赖关系,但没有运气。我搜索了多个论坛,并尝试了许多解决方案,但没有运气。我很乐意提供任何建议和反馈。

谢谢!

解决方案

bcrypt-ruby 3.0.1 was大约2年前发布,与您的环境不兼容。你必须使用最新版本[3.1.2]。



这就是我在Gemfile中声明的方式:

  gem' bcrypt-ruby',github:'codahale / bcrypt-ruby'

  gem'bcrypt-ruby','3.1.2'

可以从 http://rubygems.org 获取它 $ b

为了消除错误(无法激活bcrypt-ruby(〜> 3.0.0),...),请转到

  ruby​​_dir / lib / ruby​​ / gems / 2.0.0 / gems / activemodel-4.0.0 / lib / active_model / secure_password.rb:47 

并将行更改为

  gem'bcrypt- ruby','〜> 3.0.0'

  gem'bcrypt-ruby','〜> 3.1.0'


Has anyone had any issues installing bcrypt 3.0.1 or 3.1.2 on Windows 8? I've tried testing different versions but i'm getting this error.

but I'm getting this error after running rails server. cannot load such file -- 2.0/bcrypt_ext "You don't have bcrypt-ruby installed in your application. please add it to your gemfile and run bundle install"

I'm using: OS: Windows 8 Rails 4.0.0 Ruby 2.0.0 bcrypt-ruby 3.0.1

my gemsfile has bcrypt defined as this. gem 'bcrypt-ruby', '3.0.1'

When I uninstalled 3.0.1 and installed 3.1.2, update my gemfile to point to 3.1.2, run bundle install, then run rails server i'm getting an error:

"can't activate bcrypt-ruby (~>3.0.0), already activated 3.1.2...make sure all dependencies are added to gemfile."

I tried doing a bundle update to make I get all the dependencies but no luck. I've searched multiple forums and tried many solutions to no luck. I'd love any advice and feedback you may have.

Thank you!

解决方案

bcrypt-ruby 3.0.1 was released about 2 years ago and is not compatible with your environment. You have to use the latest release [3.1.2].

That's how I declared it in my Gemfile:

gem 'bcrypt-ruby', github: 'codahale/bcrypt-ruby'

or

gem 'bcrypt-ruby', '3.1.2'

to get it from http://rubygems.org

To get rid of error (can't activate bcrypt-ruby (~> 3.0.0), ...) go to

ruby_dir/lib/ruby/gems/2.0.0/gems/activemodel-4.0.0/lib/active_model/secure_password.rb:47

and change the line to

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

to

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

这篇关于在Windows上使用bcrypt 3.0.1与ruby2.0的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆