views:

285

answers:

2
qichunren@zhaobak:~> gem install hpricot
ERROR:  While executing gem ... (Gem::FilePermissionError)
    You don't have write permissions into the /opt/ruby-enterprise-1.8.7/lib/ruby/gems/1.8 directory.

Current login user is qichunren, and qichunre user have write permission with .gem dir.I would like to know why gem not install files into my home .gem dir first? Why my gem common first want to install files into /opt/ruby-enterprise-1.8.7/lib/ruby/gems/1.8

+1  A: 

Try setting GEM_HOME and GEM_PATH to ~/.gem, follow directions here: http://forums.site5.com/showthread.php?t=11954

meagar
+1  A: 

Use sudo to acquire the requisite permissions for a normal gem install.

sudo gem install hpricot

Otherwise, you will need set explicit configuration parameters to indicate where the gem should be installed to.

Justice