I've just installed Ruby Enterprise Edition on a fresh Ubuntu 10.04 server. I went to install my first gem, and hit a weird problem I never saw before.
Without sudoing, if I just type 'gem' I get the blurb about gem. I can switch to root and do gem install gemname
or give the full path to the gem exe, but if I do sudo gem install gemname
I get an odd error sudo: gem: command not found
.
If I do gem install gemname
without sudo, it tells me I don't have permission to alter the gem folder (which is fair enough). It looks like something funny's happening when I sudo, basically.
I've added the Ruby bin path to my PATH variable in my .bashrc file, like so:
export PATH=/opt/ruby-enterprise-1.8.7-2011.01/bin:$PATH
then reloaded .bashrc with source
. Any ideas, anyone?