Here is my error:
rake aborted!
Gem::LoadError: You have already activated rake 10.3.1, but your Gemfile requires rake 10.2.2. Prepending `bundle exec` to your command may solve this.
/Users/AaronWilliamson/.gem/ruby/2.1.0/gems/bundler-1.5.3/lib/bundler/runtime.rb:34:in `block in setup'
/Users/AaronWilliamson/.gem/ruby/2.1.0/gems/bundler-1.5.3/lib/bundler/runtime.rb:19:in `setup'
/Users/AaronWilliamson/.gem/ruby/2.1.0/gems/bundler-1.5.3/lib/bundler.rb:119:in `setup'
/Users/AaronWilliamson/.gem/ruby/2.1.0/gems/bundler-1.5.3/lib/bundler/setup.rb:7:in `<top (required)>'
/Users/AaronWilliamson/Desktop/Ripelist-Classifieds/config/boot.rb:4:in `<top (required)>'
/Users/AaronWilliamson/Desktop/Ripelist-Classifieds/config/application.rb:1:in `<top (required)>'
/Users/AaronWilliamson/Desktop/Ripelist-Classifieds/Rakefile:4:in `<top (required)>'
LoadError: cannot load such file -- bundler/setup
/Users/AaronWilliamson/Desktop/Ripelist-Classifieds/config/boot.rb:4:in `<top (required)>'
/Users/AaronWilliamson/Desktop/Ripelist-Classifieds/config/application.rb:1:in `<top (required)>'
/Users/AaronWilliamson/Desktop/Ripelist-Classifieds/Rakefile:4:in `<top (required)>'
(See full trace by running task with --trace)
I can't run any rake tasks and this seems to be the root of all my other problems. It wasn't like this a couple days ago when I was running rake commands. Can anyone explain what's going on here and how to get my app back on track? I've hit a wall. Also, bundle exec
doesn't fix the root of the problem for me. I never had to do that in the past and it's still not working now.
Go in the
Gemfile.lock
, find the rake file and update the version there.I got this error:
What I did was to change the version of rake in the
Gemfile.lock
from:rake (11.1.2)
torake (11.2.2)
.Everything worked fine after that.
Type this command:
bundle update rake
works for me as well.My error was
Gem::LoadError: You have already activated rake 12.3.1, but your Gemfile requires rake 12.3.0. Prepending
bundle execto your command may solve this.
I meet the similar problem. My solution is change the line of rake version "gem 'rake', '~> 10.3'" in file Gemfile, delete Gemfile.lock and run 'bundler install', the new Gemfile.lock will show the new version 10.3.1. Then everything will be fine.
As mentioned on earlier answers this is a simple issue which happens when your gemset has a rake version that is newer than the version number your
Gemfile.lock
mentions.The easiest way to debug this is to run
bundle update
.The other ways could be to remove
Gemfile.lock
and runningbundle install
or simply deleting the line inGemfile.lock
that corresponds to the rake version and trybundle install
. But this might sometimes corrupt the Gemfile. I would prefer the first method because it is the safest and the easiest.According to this solution (that worked for me) : https://stackoverflow.com/a/23668399/4260090
You can solve it by using
rubygems-bundler
Type these commands in your terminal :
It should work now