Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rails - Getting Rake error

When running rake commands, I get this error:

You have already activated rake 10.0.2, but your Gemfile requires rake 11.1.1. 
Prepending `bundle exec` to your command may solve this.

How do I fix this so that I don't have to run bundle exec before every rake command?

I uninstalled rake and reinstalled, but it's still looking for an older version:

C:/Ruby22-x64/bin/rake:22:in `load': cannot load such file -- C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rake-10.4.2/bin/rake (LoadError)
        from C:/Ruby22-x64/bin/rake:22:in `<main>'
like image 776
Raymond R Avatar asked Mar 15 '16 23:03

Raymond R


2 Answers

run

$ bundle update rake

that worked for me.

see the documentation. http://bundler.io/v1.3/man/bundle-update.1.html

like image 103
Anurag Kumar Avatar answered Sep 29 '22 07:09

Anurag Kumar


Pretty simple:

gem install rake -v 11.1.1
like image 36
tadman Avatar answered Sep 29 '22 07:09

tadman