1

I am trying to upgrade a very small devise application to ruby 2 and rails 4. I get a missing bcrypt-ruby (a dependency of devise) error when I try to start the rails server or input db commands.

How can I force devise to use the newer version of bcrypt-ruby that is in the gemfile (3.1.1) and not the auto installed dependency (3.0.1) because adding "bcrypt-ruby 3.1.1" to gemfile and running bundle update/install does does not seem to solve the problem.

$ rails s
You have requested:
  bcrypt-ruby = 3.1.1

The bundle currently has bcrypt-ruby locked at 3.0.1.
Try running `bundle update bcrypt-ruby`
Run `bundle install` to install missing gems.

Gemfile:

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

Gemfile.lock

devise (3.0.0)
      bcrypt-ruby (~> 3.0)
LightBox
  • 3,395
  • 4
  • 25
  • 38
  • 1
    You are forced to use a 3.0 version of bcrypt-ruby until devise changes the dependency (or you can fork devise and point your app to a hacked repo). Devise is using `~> 3.0` - see http://docs.rubygems.org/read/chapter/16 - so 3.0.1, 3.0.2, etc are all valid but not 3.1 – house9 Jul 27 '13 at 16:32

1 Answers1

2

house9 is correct.

I've forked the repo and updated the dependency, you can try it by using this in your Gemfile:

gem 'devise', :git => 'https://github.com/Arkham/devise.git', :branch => 'update_bcrypt'
Ju Liu
  • 3,939
  • 13
  • 18