如何将 RVM 中的 gemset 设为默认值? [英] how to make a gemset in RVM the default?

查看:34
本文介绍了如何将 RVM 中的 gemset 设为默认值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每当我在 Mac OS X 中启动新终端时,我都会尝试将 gemset 设为默认值:

I'm trying to make a gemset the default whenever I start a new terminal in Mac OS X:

rvm use 1.9.3@rails3.2 --create --default

这似乎可行,rails3.2 gemset 成为当前 gemset:

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

$

但是当我打开一个新终端时,rails3.2 gemset 不再是当前的:

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

$

我该怎么办?

推荐答案

你有没有试过在 gemset 创建后指定 rvm --default use 所以通过:

Have you tried specifying rvm --default use after the gemset is created so passing:

 rvm --default use ruby-1.9.3-p0@rails3.2

然后看看是否坚持?我以前没有尝试过同时使用 create 和 default ,这是唯一让我觉得格格不入的事情.

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.

鉴于下面的讨论,我将提供此作为解决问题的一种方法.(就个人而言,我可能会implode rvm 并重新开始.)但是,如果您想尝试通过此安装进行操作,那么我会查看您的 .rvm 文件夹,特别是在 .rvm/environments/default 中包含为默认环境导出的所有环境变量.在这里您会发现 rvm_gemset_name 这可能设置不正确并且由于某种原因(权限?)没有更新,或者设置正确,在这种情况下它的一些其他环境问题.如果不正确,您可以尝试在文件中手动设置它.

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 中的 gemset 设为默认值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆