我正在尝试创建一个gemset。首先,我做了
$ 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.
然后,按照https://stackoverflow.com/a/5716654/429850的答案,我做了
$ 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
如何在多用户rvm安装中创建gemsets?
更新:重新启动计算机并将自己添加到rvm组后,我似乎仍然无法做到:
$ 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'.
答案 0 :(得分:3)
对于多用户/系统范围的安装,您需要将需要rvm
访问权限的每个用户添加到rvm
组。