can’t activate bcrypt-ruby (~> 3.0.0), already activated bcrypt-ruby-3.1.1. Make sure all dependencies are added to Gemfile

In your gemfile, you aren’t specifying the version, so you’re installing the latest version of bcrypt-ruby which is 3.1.1, but what you need is any version from 3.0.0 to 3.0.9. You can get this by adding a version constraint like so:

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

The version requirement comes from ActiveModel’s SecurePassword which currently has an explicit dependency on bcrypt-ruby (~> 3.0.0). You can see the dependency on github. When this code is executed, it looks for a version 3.0.0 through 3.0.9 which is not installed and so it throws an error.

This dependency was just updated to ‘~> 3.1.0’ a couple of days ago, but has not made its way into the rails activemodel gem yet. When it does, you’ll have to update your version accordingly. Here’s the commit if you’re curious.

Leave a Comment