Thoughts on web programming and the world of technology

June 10, 2011, reading time: under one minute

Install Ruby gems into virtualenv

You are a Python developer and every time you have to install a Ruby gem you throw up in your mouth a little. Wouldn’t it be nice if you could install Ruby gems into your virtualenv? Yeah, it would.

Stick this in your virtualenv’s postactivate script:

export GEM_HOME="$VIRTUAL_ENV/gems"
export GEM_PATH=""
export PATH=$PATH:"$GEM_HOME/bin"

That’s it! You’re welcome. :)

Credit

Give credit where credit is due. I stole this idea from Idan Gazit and made it better.