2

I am trying to create a gemset. First, I did

$ rvm gemset create rails-1.3.7
mkdir: /usr/local/rvm/gems/ruby-1.9.2-p320@rails-1.3.7: Permission denied
Gemset 'rails-1.3.7' does not exist, 'rvm gemset create rails-1.3.7' first, or append '--create'.
Can not create environment file for 'rails-1.3.7', Could not use ruby. 
$ sudo rvm gemset create rails-1.3.7
Password:
Can not create gemset before using a ruby.  Try 'rvm use <some ruby>'.
$ rvm use 1.9.3
Using /usr/local/rvm/gems/ruby-1.9.3-p194
$ sudo rvm gemset create rails-1.3.7
Can not create gemset before using a ruby.  Try 'rvm use <some ruby>'.
$ sudo rvm use 1.9.3

RVM is not a function, selecting rubies with 'rvm use ...' will not work.
You need to change your terminal settings to allow shell login.
Please visit https://rvm.io/workflow/screen/ for example.

Then, accoriding to the answer at https://stackoverflow.com/a/5716654/429850, I did

$ export rvm_gems_path="$HOME/.rvm/gems" 
$ rvm gemset create rails-3.1.7
/usr/local/rvm/scripts/functions/environment: line 94: /usr/local/rvm/environments/ruby-1.9.3-p194@rails-3.1.7: Permission denied
/usr/local/rvm/scripts/functions/environment: line 105: /usr/local/rvm/environments/ruby-1.9.3-p194@rails-3.1.7: Permission denied
/usr/local/rvm/scripts/functions/environment: line 105: /usr/local/rvm/environments/ruby-1.9.3-p194@rails-3.1.7: Permission denied
/usr/local/rvm/scripts/functions/environment: line 105: /usr/local/rvm/environments/ruby-1.9.3-p194@rails-3.1.7: Permission denied
/usr/local/rvm/scripts/functions/environment: line 105: /usr/local/rvm/environments/ruby-1.9.3-p194@rails-3.1.7: Permission denied
/usr/local/rvm/scripts/functions/environment: line 105: /usr/local/rvm/environments/ruby-1.9.3-p194@rails-3.1.7: Permission denied
/usr/local/rvm/scripts/functions/environment: line 105: /usr/local/rvm/environments/ruby-1.9.3-p194@rails-3.1.7: Permission denied
/usr/local/rvm/scripts/functions/environment: line 105: /usr/local/rvm/environments/ruby-1.9.3-p194@rails-3.1.7: Permission denied
/usr/local/rvm/scripts/functions/environment: line 105: /usr/local/rvm/environments/ruby-1.9.3-p194@rails-3.1.7: Permission denied
/usr/local/rvm/scripts/functions/environment: line 105: /usr/local/rvm/environments/ruby-1.9.3-p194@rails-3.1.7: Permission denied
/usr/local/rvm/scripts/functions/environment: line 107: /usr/local/rvm/environments/ruby-1.9.3-p194@rails-3.1.7: Permission denied
/usr/local/rvm/scripts/functions/environment: line 107: /usr/local/rvm/environments/ruby-1.9.3-p194@rails-3.1.7: Permission denied
mkdir: /usr/local/rvm/wrappers/ruby-1.9.3-p194@rails-3.1.7: Permission denied

How do you create gemsets in a multi-user rvm installation?

Update: After re-starting the computer, and adding myself to the rvm group, I still can't seem to do it:

$ rvm use 1.9.2
Gemset '' does not exist, 'rvm gemset create ' first, or append '--create'.
$ rvm gemset create rails-3.1.7
'rails-3.1.7' gemset created (/Users/yasir/.rvm/gems/ruby-1.9.3-p194@rails-3.1.7).
$ rvm use 1.9.2
Gemset '' does not exist, 'rvm gemset create ' first, or append '--create'.
$ rvm rails-3.1.7
Unknown ruby interpreter version: '3.1.7'.
$ rvm 1.9.2
Gemset '' does not exist, 'rvm gemset create ' first, or append '--create'.
$ rvm gemset create 1.9.2
'1.9.2' gemset created (/Users/yasir/.rvm/gems/ruby-1.9.3-p194@1.9.2).
$ rvm 1.9.2
Gemset '' does not exist, 'rvm gemset create ' first, or append '--create'.
$ rvm use 1.9.2
Gemset '' does not exist, 'rvm gemset create ' first, or append '--create'.
Community
  • 1
  • 1
highBandWidth
  • 16,751
  • 20
  • 84
  • 131
  • 3
    Don't mix sudo with non-sudo rvm. Best not use sudo at all. – Thilo Aug 09 '12 at 18:19
  • @Thilo, I only used sudo when it said permission denied. How do I solve the problem? – highBandWidth Aug 09 '12 at 18:20
  • 1
    It should not deny any permissions, unless you accidentally installed something as root. Check out http://stackoverflow.com/questions/3644897/rvm-cannot-use-ruby-with-sudo if you must use sudo, but I'd recommend a clean install of rvm under your user account. – Thilo Aug 09 '12 at 18:21
  • 2
    Oh I see, this is a system wide install. That's not recommended because it may lead to exactly these kinds of problems. See https://rvm.io/rvm/install/. – Thilo Aug 09 '12 at 18:32

1 Answers1

3

For multi-user / system wide installation, you need to add each user that needs access to rvm to the rvm group.

Rog
  • 18,602
  • 6
  • 76
  • 97