When running rake I get this error:
You have already activated rake 0.9.2, but your Gemfile requires rake 0.8.7. Consider using bundle exec.
Using bundle exec rake instead of just rake seems to work, but is it the best way to fix this?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Using
bundle execis the right way to do this.Basically what’s happening is that you’ve updated rake to 0.9.2 which now conflicts with the version specified in your Gemfile. Previously the latest version of
rakeyou had matched the version in your Gemfile, so you didn’t get any warning when simply usingrake.Yehuda Katz (one of the original Bundler developers) explains it all in this blog post.
To avoid typing
bundle exec ...all the time, you could set up an alias or function in your shell for commands you commonly use with Bundler. For example this is what I use for Rake: