gem install permission problem
Try setting GEM_HOME
and GEM_PATH
to ~/.gem
,
For the current terminal session, just type:
export GEM_HOME=~/.gemexport GEM_PATH=~/.gem
If you want these to be set whenever you open a terminal, add the above commands to your ~/.bashrc
file.
For a more comprehensive solution to setting up a custom ruby environment, see this tutorial from Site5KB, which describes using a .gemrc
file.
For a systemwide Ruby install, become root. For example:
$ sudo gem install hpricot
However, the modern approach in many circumstances, including in development, is to use a tool that lets you easily install and use Ruby as a normal user. This lets you avoid having to become root. There are a few such tools, and the one I use is RVM.
# install rvm into your ~$ \curl -sSL https://get.rvm.io | bash -s stable# install latest version of ruby into your ~$ rvm install ruby# installs a gem into your ~$ gem install $SOME_GEM_NAME
I was getting this error on my shared server through 1and1 hosting. my solution was adding the --user-install
option, which just installs it for your logged in user (which is all you need in a shared server environment)example; installing sass
gem install sass --user-install