→ Local Gems

07 February 2008

Why do we always type sudo when installing and uninstalling gems on our dev machine? There’s no point. Keep your gems in your home directory so they’re easier to hack around with and backup:

alias gemi='gem install --no-rdoc --no-ri -y'
export GEM_HOME="$HOME/.gems"
export GEM_PATH="$GEM_HOME"
export PATH="$HOME/.gems/bin:$PATH"

I’m not talking about vendor everything here – this is strictly for gems installed on your dev machine. Like Thin. Or Hpricot. Or cheat.