I'm trying to make a gemset the default whenever I start a new terminal in Mac OS X:
每当我在Mac OS X中启动一个新终端时,我都试图将gemset设为默认值:
rvm use 1.9.3@rails3.2 --create --default
That seems to work, the rails3.2 gemset becomes the current gemset:
这似乎有效,rails3.2 gemset成为当前的gemset:
$ rvm gemset list
gemsets for ruby-1.9.3-p0 (found in /Users/me/.rvm/gems/ruby-1.9.3-p0)
global
=> rails3.2
$
But when I open up a new terminal, the rails3.2 gemset is no longer the current:
但是当我打开一个新的终端时,rails3.2 gemset不再是当前的:
$ rvm gemset list
gemsets for ruby-1.9.3-p0 (found in /Users/me/.rvm/gems/ruby-1.9.3-p0)
global
rails3.2
$
What do I do?
我该怎么办?
5 个解决方案
#1
46
Have you tried specifying rvm --default use
after the gemset is created so passing:
您是否尝试在创建gemset后指定rvm --default使用,以便传递:
rvm --default use ruby-1.9.3-p0@rails3.2
and then seeing if that sticks? Using create and default at the same time isn't something I've tried before, it's the only thing that strikes me as out of place.
然后看看是否粘?同时使用create和default不是我以前尝试过的东西,它是唯一让我觉得不合适的东西。
Given the discussion below I'd offer this as a means for dealing with the problem. (Personally, I'd probably implode rvm and start over.) But, if you wanted to try to make a go of it with this install then I'd look at your .rvm
folder, specifically in .rvm/environments/default
which will contain all the environment variables exported for the default environment. Here you'll find rvm_gemset_name
this may be set incorrectly and isn't updated for some reason (permissions?) or is set correctly in which case its some other environment issue. You could try manually setting it here in the file if its not correct.
鉴于下面的讨论,我将此作为处理问题的手段。 (就我个人而言,我可能会破坏rvm并重新开始。)但是,如果您想尝试使用此安装进行操作,那么我会查看您的.rvm文件夹,特别是在.rvm / environments / default中将包含为默认环境导出的所有环境变量。在这里您可以找到rvm_gemset_name,这可能设置不正确,并且由于某种原因(权限?)没有更新,或者在这种情况下正确设置了其他一些环境问题。如果不正确,您可以尝试在文件中手动设置它。
#2
6
Use following command to make a gemset as default.
使用以下命令将gemset设置为默认值。
rvm use <ruby version>@<gemset name> --default
eg.
例如。
rvm use 1.8.7-p370@mygemset --default
#3
6
You can use this command.
您可以使用此命令。
rvm use --default <ruby version>@<gemset name>
or
要么
rvm --default use <ruby version>@<gemset name>
or
rvm --default使用 @
rvm use <ruby version>@<gemset name> --default
#4
0
You can use this command
您可以使用此命令
$ rvm use <ruby version>@<gemset name> --create --ruby-version
$ rvm使用 @
For example : ruby version = ruby-2.1.2 gemset name = gem320
例如:ruby version = ruby-2.1.2 gemset name = gem320
It would be
这将是
$ rvm use ruby-2.1.2@gem320 --create --ruby-version.
$ rvm使用ruby-2.1.2@gem320 --create --ruby-version。
Even if you open other tab also, it will preserve the settings.
即使您也打开其他选项卡,它也会保留设置。
#5
0
Interesting that nobody has mentioned rvm alias. Try your version-specific variation of this, works for me:
有趣的是,没有人提到rvm别名。尝试针对特定版本的版本,对我有用:
$ rvm alias create default ruby-2.3.0@rails_4_2_6
# me logs out, fetches another coffee
# me logs in
$ rvm list
rvm rubies
ruby-2.2.4 [ x86_64 ]
=* ruby-2.3.0 [ x86_64 ]
$ rvm gemset list
gemsets for ruby-2.3.0 (found in /home/aclarke/.rvm/gems/ruby-2.3.0)
(default)
global
=> rails_4_2_6
#1
46
Have you tried specifying rvm --default use
after the gemset is created so passing:
您是否尝试在创建gemset后指定rvm --default使用,以便传递:
rvm --default use ruby-1.9.3-p0@rails3.2
and then seeing if that sticks? Using create and default at the same time isn't something I've tried before, it's the only thing that strikes me as out of place.
然后看看是否粘?同时使用create和default不是我以前尝试过的东西,它是唯一让我觉得不合适的东西。
Given the discussion below I'd offer this as a means for dealing with the problem. (Personally, I'd probably implode rvm and start over.) But, if you wanted to try to make a go of it with this install then I'd look at your .rvm
folder, specifically in .rvm/environments/default
which will contain all the environment variables exported for the default environment. Here you'll find rvm_gemset_name
this may be set incorrectly and isn't updated for some reason (permissions?) or is set correctly in which case its some other environment issue. You could try manually setting it here in the file if its not correct.
鉴于下面的讨论,我将此作为处理问题的手段。 (就我个人而言,我可能会破坏rvm并重新开始。)但是,如果您想尝试使用此安装进行操作,那么我会查看您的.rvm文件夹,特别是在.rvm / environments / default中将包含为默认环境导出的所有环境变量。在这里您可以找到rvm_gemset_name,这可能设置不正确,并且由于某种原因(权限?)没有更新,或者在这种情况下正确设置了其他一些环境问题。如果不正确,您可以尝试在文件中手动设置它。
#2
6
Use following command to make a gemset as default.
使用以下命令将gemset设置为默认值。
rvm use <ruby version>@<gemset name> --default
eg.
例如。
rvm use 1.8.7-p370@mygemset --default
#3
6
You can use this command.
您可以使用此命令。
rvm use --default <ruby version>@<gemset name>
or
要么
rvm --default use <ruby version>@<gemset name>
or
rvm --default使用 @
rvm use <ruby version>@<gemset name> --default
#4
0
You can use this command
您可以使用此命令
$ rvm use <ruby version>@<gemset name> --create --ruby-version
$ rvm使用 @
For example : ruby version = ruby-2.1.2 gemset name = gem320
例如:ruby version = ruby-2.1.2 gemset name = gem320
It would be
这将是
$ rvm use ruby-2.1.2@gem320 --create --ruby-version.
$ rvm使用ruby-2.1.2@gem320 --create --ruby-version。
Even if you open other tab also, it will preserve the settings.
即使您也打开其他选项卡,它也会保留设置。
#5
0
Interesting that nobody has mentioned rvm alias. Try your version-specific variation of this, works for me:
有趣的是,没有人提到rvm别名。尝试针对特定版本的版本,对我有用:
$ rvm alias create default ruby-2.3.0@rails_4_2_6
# me logs out, fetches another coffee
# me logs in
$ rvm list
rvm rubies
ruby-2.2.4 [ x86_64 ]
=* ruby-2.3.0 [ x86_64 ]
$ rvm gemset list
gemsets for ruby-2.3.0 (found in /home/aclarke/.rvm/gems/ruby-2.3.0)
(default)
global
=> rails_4_2_6