On all my gem installs I have to do sudo ? So
sudo gem install rails
will work, while only
gem install rails
will not work. How do I remedy it ?
I have rvm installed -
murtaza@murtaza-dev:~$ which rvm
/home/murtaza/.rvm/bin/rvm
murtaza@murtaza-dev:~$ which gem
/home/murtaza/.rvm/rubies/ruby-1.9.3-p194/bin/gem
However I am also getting this warning when I do any operations with gem -
murtaza@murtaza-dev:~$ gem
/home/murtaza/.rvm/rubies/ruby-1.9.3-p194/bin/gem:4: warning: Insecure world writable dir /opt in PATH, mode 040777
EDIT
I have reinstalled rvm using curl -L get.rvm.io | bash -s stable --auto
(without sudo).
However still when I try installing gem it gives me the following error -
murtaza@murtaza-dev:~$ gem install rails
/home/murtaza/.rvm/rubies/ruby-1.9.3-p194/bin/gem:4: warning: Insecure world writable dir /opt in PATH, mode 040777
ERROR: While executing gem ... (Errno::EACCES)
Permission denied - /home/murtaza/.gem/specs
EDIT
I did chown on the whole thing but still getting the error -
murtaza@murtaza-dev:~$ sudo chown murtaza.murtaza -R ~/.rvm/*
murtaza@murtaza-dev:~$ gem install rails
/home/murtaza/.rvm/rubies/ruby-1.9.3-p194/bin/gem:4: warning: Insecure world writable dir /opt in PATH, mode 040777
ERROR: While executing gem ... (Errno::EACCES)
Permission denied - /home/murtaza/.gem/specs
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…