bcrypt error: Devise ruby 2.0 and rails 4.0

前端 未结 6 620
感情败类
感情败类 2020-12-24 08:45

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

相关标签:
6条回答
  • 2020-12-24 09:18

    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 gem mingw32 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

    0 讨论(0)
  • 2020-12-24 09:25

    The new version of bundler just came out. It nows about x64 gems

    gem install bundler -v '1.4.0.pre.2'
    
    0 讨论(0)
  • 2020-12-24 09:27

    Seems like the downfall of using windows as a development platform for ROR apps. I need to use Ruby 2.0 32 bit in order to get PG gem for a postgresql connection to work or I have to use Ruby 2.0 64 bit to get 'Devise' gem to work.

    0 讨论(0)
  • 2020-12-24 09:30

    On problem with has_secure_password on Window 7 helps this

    gem uninstall bcrypt-ruby

    gem uninstall bcrypt

    gem install bcrypt-ruby --platform=ruby --no-ri --no-rdoc

    gem install bcrypt --platform=ruby --no-ri --no-rdoc

    Add to Gemfile:

    gem 'bcrypt-ruby', '~> 3.0.0', :require => 'bcrypt'
    gem 'bcrypt'
    

    bundle install

    0 讨论(0)
  • 2020-12-24 09:32

    Until this problem is fixed, the best workaround is to install bcrypt-ruby from git:

    gem 'bcrypt-ruby', git: 'https://github.com/codahale/bcrypt-ruby.git', :require => 'bcrypt'
    

    Update (June 2016.) - as @gneri mentioned, bcrypt-ruby changed it's name to bcrypt, so use:

    gem 'bcrypt', git: 'https://github.com/codahale/bcrypt-ruby.git', :require => 'bcrypt'
    
    0 讨论(0)
  • 2020-12-24 09:38

    turns out that it was a problem with the version of ruby that i was using. I was using ruby 2 (32bit).

    but if you switch to the 64bit version of ruby 2 the error goes away.

    0 讨论(0)
提交回复
热议问题