Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Ruby Build a Simple Ruby on Rails Application Frontend Development Updating the Index Page

Steven Meyer
Steven Meyer
933 Points

rake stopped working

When I tried to use rake I got the following error message.

C:\projectsclone\treebook>rake routes rake aborted! Gem::LoadError: You have already activated rake 10.4.0, but your Gemfile require s rake 10.3.2. Prepending bundle exec to your command may solve this. C:/projectsclone/treebook/config/boot.rb:6:in <top (required)>' C:/projectsclone/treebook/config/application.rb:1:in<top (required)>' C:/projectsclone/treebook/Rakefile:5:in `<top (required)>' (See full trace by running task with --trace)

C:\projectsclone\treebook>

Was working fine until then.

Anyone got any suggestions?

I have no idea how rake updates got out of sync with the rest of my rails installation help.

Would a fresh installation help?

4 Answers

Steven,

I would follow the instructions in your error message and use bundle exec like so:

bundle exec rake routes

This will sometimes happen when you have installed newer gem versions than those required or if your Ruby version has been updated and the gems you need to use haven't yet been updated to the spec of the new Ruby version.

The bundle exec will run the command in the context of the Gemfile used in the app and not the gem versions installed on your machine.

Nathan

You could also edit the Gemfile itself to match the rake version that's called for in the error.

I did this the other day and it worked like a charm! :grinning:

Steven Meyer
Steven Meyer
933 Points

I'll give it a try thanks.

Haven't been able to do much today because practically the whole of ruby / rails community was down due to DDOS attack on dnsimple name server. I was trying to do a fresh install with ruby > 2.0.0 and got caught in the middle. :(

Steven Meyer
Steven Meyer
933 Points

Thanks that worked.