RudyGems

Matthew Rudy Jacobs
see me swim
Github
see some of my code
Thought Sauce
Hire me in Hong Kong

Fed up of `bundle exec rake`? Control your `rage`!

For the past year we’ve all been happy.

rake was stable at 0.8.7

You could run

rake

In any project and it’d just work.

But now, with the release of rake 0.9.0, sometimes we get this

RudiMac:3rdhome matthew$ rake
rake aborted!
You have already activated rake 0.9.0,
but your Gemfile requires rake 0.8.7.
Consider using bundle exec.

(See full trace by running task with --trace)

And there’s a simple solution.

RAGE!

#!/usr/bin/env bash
if [ -f Gemfile ]; then
  bundle exec rake $@
else
  rake $@
fi

Either copy and paste the gist into an executable (~/bin/rage maybe)

Or follow these instructions;

git clone git://gist.github.com/1003927.git ~/rage-gist
mkdir ~/bin
cp ~/rage-gist/rage ~/bin/
chmod a+x ~/bin/rage

As long as ~/bin is in your path you should be set.

rage db:migrate test --trace

BOOM!