nraj
nraj

Reputation: 31

Gem installation error for non-root user

I did RVM single user installation on my CentOS server as root user, so rvm location is /usr/local.. However, now we have to use individual user accounts.
So now if I try to install a new gem, for instance -

  1. gem install linecache19 -v '0.5.12'

    ERROR: While executing gem ... (Gem::FilePermissionError) You don't have write permissions into the /usr/local/rvm/gems/ruby-1.9.2-p320@cams directory.

  2. sudo gem install linecache19 -v '0.5.12'

    /usr/local/rvm/rubies/ruby-1.9.2-p320/bin/gem:12:in `require': no such file to load -- rubygems (LoadError) from /usr/local/rvm/rubies/ruby-1.9.2-p320/bin/gem:12

Point to note: I thought of re-installing the rubies and rvm with individual user account and do away with root installation. But I already have some apps running on the server as staging, so want to avoid this.

How can I solve these problems?

Upvotes: 1

Views: 3963

Answers (1)

mpapis
mpapis

Reputation: 53158

You obviously missed to read RVM installation documentation and overall RVM docs.

For part 1. you need to run rvmsudo rvm get stable and add your users to rvm group.

For part 2. do not use sudo it looses all environment settings - which leads to the error you see, either add your users to rvm group or run with rvmsudo.

Upvotes: 4

Related Questions