Question

I'm following Michael Hartl's tutorial for Rails 4, and I'm working on the user auth section. He says to add bcrypt-ruby to the Gemfile, then bundle install.

Here's the line from my Gemfile:

gem 'bcrypt-ruby', '3.1.2' // as explained at http://ruby.railstutorial.org/chapters/modeling-users#code-bcrypt_ruby

I ran bundle install and then rails console to test the system. Creating a new user throws the following error:

You don't have bcrypt-ruby installed in your application. Please add it to your Gemfile and run bundle install
Gem::LoadError: can't activate bcrypt-ruby (~> 3.0.0), already activated bcrypt-ruby-3.1.2. Make sure all dependencies are added to Gemfile.

The bundle install worked fine and didn't throw any errors-- why is this failing here, with an error saying bcrypt-ruby is not installed?

EDIT: this appears to be a duplicate of this question: Unable to activate bcrypt-ruby (~> 3.0.0), already activated bcrypt-ruby-3.1.2?

Was it helpful?

Solution

You need bcrypt-ruby version 3.0.0

Change the version in your Gemfile

gem 'bcrypt-ruby', '~> 3.0.0'
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top