-
-
Save matthewrudy/1003927 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash | |
# | |
# Usage: rage db:migrate --trace | |
# should work transparently like rake | |
# | |
# if we're in a directory controlled by bundler | |
# we do bundle exec rake | |
if [ -f Gemfile ]; then | |
bundle exec rake $@ | |
# otherwise we use the system / rvm rake | |
else | |
rake $@ | |
fi |
that's fine mortice.
But if I'm jumping between projects (some on rake 0.9.0, some on rake 0.8.7, some which don't care) then this suits me.
I imagine in a few weeks I'll upgrade everything to rake 0.9.0 anyway,
just need to do some testing on servers before I deploy.
Have you tried putting a .rvmrc file in each project root specifying the gemsets to use in the mean time?
oh jeez.
that's clever.
I said to my colleague when I went to lunch "it'd be cool if you could do [what rvmrc's do]"
well, i always use bundle now so for me is simpler to just do: (add to your ~/.alias.setup or ~/.bashrc)
alias rake='bundle exec rake $@'
And just keep typing "rake" as I usually do... it works just fine. (bundle exec looks for "rake" in whatever bundle path and it can't see your alias, which is just for your interactive shell)
Use gemsets or try bundle install --binstubs and put Rails.root/bin in your $PATH. :)