Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

This thing is driving me nuts.

I've installed RVM on a CentOS server; I followed the mixed mode instructions perfectly. https://rvm.io/rvm/install/

When I try to do a "gem install" from a user account however, I get this:

You don't have write permissions into the /usr/local/rvm/gems/ruby-1.9.3-p194 directory.

It is my understanding that if RVM mixed mode is set up properly, users can install their own gems. It's not feasible here for me to give all ruby users the ability to install gems globally.

Here's what I've done after login:

    # gem install rails
    -bash: gem: command not found
    # rvm use 1.9.3
    Using /usr/local/rvm/gems/ruby-1.9.3-p194
    Running /usr/local/rvm/hooks/after_use
    # gem install rails
    ERROR:  While executing gem ... (Gem::FilePermissionError)
        You don't have write permissions into the /usr/local/rvm/gems/ruby-1.9.3-p194 directory.

Okay, I have a lead (a related question popped up on here).

My gem path is:

    # echo $GEM_PATH
    /usr/local/rvm/gems/ruby-1.9.3-p194:/usr/local/rvm/gems/ruby-1.9.3-p194@global

Doesn't seem right.

share|improve this question

1 Answer 1

And as usual, after fighting with it for hours, I figure it out immediately after I ask the question.

Due to the way RVM works with multiple modes it's relatively easy to botch the install and have to re-install. While doing this, I cleared all traces of RVM from the system, including the user's .rvmrc file.

For whatever reason, this file did not appear on reinstall. Replacing it with the default file fixed the GEM_PATH and now I can install gems.

Here's the default .rvmrc:

    export rvm_environments_path="${HOME}/.rvm/environments"
    export rvm_gems_path="${HOME}/.rvm/gems"
    export rvm_gems_cache_path="${HOME}/.rvm/gems_cache"
    export rvm_wrappers_path="${HOME}/.rvm/wrappers"
share|improve this answer
    
this is how mixed mode runs, you need to tell rvm somehow that you want to use parts of local dirs –  mpapis Sep 20 '12 at 9:51

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.