Skip to content

/errors/bundler/you-have-already-activated

You have already activated rake 13.2.1, but your Gemfile requires rake 13.0.6

The commands on this page have not been executed by our verification runner yet.updated
tool
Bundler
exit code
1
versions
Bundler 2.x
os
linux, macos, windows

You have already activated rake 13.2.1, but your Gemfile requires rake 13.0.6. Prepending bundle exec to your command may solve this. means RubyGems loaded one version of a gem (usually the newest installed one) and then Bundler tried to set up the bundle, whose Gemfile.lock pins a different version. Ruby cannot load two versions of the same gem in one process, so Bundler raises Gem::LoadError. Run the command through bundle exec so Bundler chooses the versions before anything is loaded.

Where it comes from

The check is in Bundler's runtime (check_for_activated_spec!): when a gem with the same name is already loaded at another version, Bundler raises the error with the two versions. If the activated gem is a default gem shipped with Ruby, the suggestion at the end changes to Since json is a default gem, you can either remove your dependency on it or try updating to a newer version of bundler that supports json as a default gem.

Fix

bash
bundle exec rake db:migrate      # instead of rake db:migrate

Use binstubs so the plain command name works inside the project:

bash
bundle binstubs rake rspec-core  # writes bin/rake and bin/rspec
bin/rake db:migrate

Or move the bundle to the version that is already activated:

bash
bundle update rake               # updates rake in Gemfile.lock, within the Gemfile constraint

For the default-gem variant, update Bundler (gem update bundler, then bundle update --bundler) or remove the explicit pin of that gem from the Gemfile.

Sources