gpt4 book ai didi

ruby - rvm default 和 global gemset 的区别

转载 作者:数据小太阳 更新时间:2023-10-29 06:31:01 26 4
gpt4 key购买 nike

我在 rvm 上使用默认的 gemset。然后我做了一个 bundle install,它没有安装任何 gem,因为它们都已经安装了。

然后我切换到全局 gemset;进行了捆绑安装,然后开始安装 gems。

gem 集列表是:

root@dev:/home/karan/realestate# rvm gemset list

gemsets for ruby-2.0.0-p195 (found in /usr/local/rvm/gems/ruby-2.0.0-p195)
(default)
=> global

我认为全局和默认具有相同的 gemset 文件夹。

最佳答案

全局记录在 rvm 站点 - http://rvm.io/gemsets/global :

Gems you install to the @global gemset for a given ruby are available to all other gemsets you create in association with that ruby.

This is a good way to allow all of your projects to share the same installed gem for a specific ruby interpreter installation.

至于default,当你没有指定gemset名称时,它只是gemset,这就是为什么它在rvm gemset list中被列在括号中的原因:

gemsets for ruby-2.0.0-p247 (found in /home/mpapis/.rvm/gems/ruby-2.0.0-p247)
(default)
global
=> rvm-site

对于 (默认)rvm-siteglobal 中的所有 gem 都可用。

您可以通过跳过 gemset 名称来选择 default gemset:

rvm use 2.0.0

或者切换到当前 ruby​​ 的 default - 如果使用了其他的:

rvm use @default

要临时访问任何 gemset,您可以使用:

rvm @global do gem install jist

这对于管理安装在 global gemset 中的 gem 特别有用 - 因此那些将在该 ruby​​ 的所有其他 gemset 中可用的 gem。

关于ruby - rvm default 和 global gemset 的区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18198764/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com