如何将RVM中的gemset设置为默认值?
每当我在 Mac OS X 中启动新终端时,我都会尝试将 gemset 设置为默认值:
rvm use [email protected] --create --default
这似乎有效,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
$
但是当我打开新终端时,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
$
我该怎么办?
I'm trying to make a gemset the default whenever I start a new terminal in Mac OS X:
rvm use [email protected] --create --default
That seems to work, the rails3.2 gemset becomes the current 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:
$ 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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
您是否尝试过在创建 gemset 后指定
rvm --default use
如此通过:然后看看是否仍然有效?同时使用 create 和 default 并不是我以前尝试过的,这是唯一让我觉得不合适的事情。
鉴于下面的讨论,我将提供此作为处理该问题的方法。 (就我个人而言,我可能会内爆rvm并重新开始。)但是 ,如果您想尝试通过此安装进行操作,那么我会查看您的
.rvm
文件夹,特别是在.rvm/environments/default
中,它将包含导出的所有环境变量对于默认环境。在这里您会发现rvm_gemset_name
这可能设置不正确,并且由于某种原因(权限?)而未更新,或者设置正确,在这种情况下是其他一些环境问题。如果不正确,您可以尝试在文件中手动设置它。Have you tried specifying
rvm --default use
after the gemset is created so passing: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.
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 findrvm_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 --default use @
或You can use this command.
or
rvm --default use <ruby version>@<gemset name>
or使用以下命令将宝石集设置为默认值。
例如。
Use following command to make a gemset as default.
eg.
有趣的是没有人提到 rvm 别名。尝试一下这个版本特定的变体,对我有用:
Interesting that nobody has mentioned rvm alias. Try your version-specific variation of this, works for me:
与 rubyracer 相关的问题也可能与 libv8 一起出现。
要解决这个问题:
步骤 1:运行以下命令卸载任何现有的 libv8 安装:
通过运行以下命令安装 rubyracer:
通过运行以下命令安装 libv8:
立即尝试捆绑安装:
rubyracer
related issue might as well come with libv8.To get around this issue:
Step 1: Run the following command to uninstall any existing installation of libv8:
Install rubyracer by running the following command:
Install libv8 by running the following command:
Try bundle install now:
您可以使用此命令
例如:
ruby version = ruby-2.1.2
gemset name = gem320
即使
您还打开其他选项卡,它也会保留设置。
You can use this command
For example :
ruby version = ruby-2.1.2
gemset name = gem320
It would be
Even if you open other tab also, it will preserve the settings.