Ruby Gem Installation Error + You don't have write permissions for the /usr/local/rvm/gems/ruby-2.0.0-p353 directory

15,591

Solution 1

chmodding isn't the best way here. Propably ok for a local machine, but not for production.

rvm is made to be used without sudo or specific/sudo rights. reinstall would be more appreciated. clean the current rvm install rvm implode

sudo rm -rf /etc/rvmrc /etc/profile.d/rvm.sh /usr/local/rvm

and then close all consoles/bashes/terminales and login in again with the user you want to use rvm with and install it again.

see also here: Error while gem install on ubuntu 12.04 aws ec2

Solution 2

Use

sudo chmod -R 777 /usr/local/rvm/gems/ruby-2.0.0-p353

sudo chmod -R 777 specific_folder_path

Thanks a lot to Rajarshi Das

Share:
15,591
Rubyist
Author by

Rubyist

I am easily available to you, but not on GOOGLE !!! RubyGem : DateFormat, SafeRandom

Updated on June 05, 2022

Comments

  • Rubyist
    Rubyist almost 2 years

    In my local machine, I am trying to install a formatter gem related to date. but while installing I am getting some strange error.

    [admin@localhost test_folder]$ gem install formatter-0.0.1.gem
    ERROR:  While executing gem ... (Gem::FilePermissionError)
    You don't have write permissions for the /usr/local/rvm/gems/ruby-2.0.0-p353
    directory.
    

    I am not able to install it locally. Operating system is CentOS and Ruby version is Ruby2.

    Thanks in advance