当我使用 Bundler 时,为什么要关心 RVM 的 Gemset 功能?

发布于 2024-10-12 03:49:13 字数 597 浏览 7 评论 0原文

我就是不明白。我认为,Bundler是为了解决gem之间的版本冲突而开发的。因此,我只需要require“bundler/setup”,一切都很好,因为知道Bundler将加载我所有gem及其依赖项的正确版本。现在,我知道,RVM 非常适合管理多个红宝石,但我为什么要关心 Gemset 功能呢?我在这里错过了什么吗?它能让我的开发变得更加容易吗?也许,你们中的一些人可以给我一些关于开发和生产的完美 RVM + Bundler 工作流程的提示。

我也不知道RVM什么时候开始切换到另一个Ruby。我知道我的项目中可以有一个 .rvmrc 文件,但是我是否必须 cd 到该目录才能进行切换?

此外,我通常使用Passenger进行开发,因为借助Passenger.prefpane,在Mac OS中的集成非常棒。我仍然可以使用 RVM 来做到这一点吗?或者有更好的方法吗? Passenger 是否能够识别 .rvmrc 文件并切换到正确的 Gemset?

I just don't get it. I thought, Bundler was developed to resolve version conflicts between gems. So that I just have to require "bundler/setup" and everything is fine, knowing that Bundler will load the correct versions of all my gems and their dependencies. Now, RVM is great for managing multiple Rubies, I know, but why should I care about the Gemset feature? Do I miss something here? Can it make my development even easier? Maybe, some of you can give me some hints on the perfect RVM + Bundler workflow for both, development and production.

I also don't know when RVM starts switching to another Ruby. I know that I can have an .rvmrc file in my project, but do I have to cd to this directory so that the switch happens?

Furthermore, I usually use Passenger for development since, thanks to the Passenger.prefpane, integration in Mac OS is great. Can I still do that with RVM or is there a better way to do it? Does Passenger recognize .rvmrc files and switch to the correct Gemset?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

筱果果 2024-10-19 03:49:13

当我使用 Bundler 时,为什么要关心 RVM 的 Gemset 功能?

你不应该。

好吧,如果你想要,当然你可以关心,所以我最好说“你不需要”。

我刚刚听了对 Bundler 核心团队成员之一的播客采访 他基本上说,自从他开始使用 Bundler 以来,他就不再使用 Gemsets,因为它们是多余的。

这是一篇讨论同一问题的博客文章,其中包含一些内容示例。

Why should I care about RVM's Gemset feature when I use Bundler?

You shouldn't.

Well, if you want to, you can care about, of course, so I should better say "You don't need to."

I just listened to a podcast interview with one of the Bundler core team members who basically said that since he started using Bundler he stopped using Gemsets, because they are redundant.

Here's a blog post that discusses the same issue, with some examples.

荒岛晴空 2024-10-19 03:49:13

当我处理遗留代码或分叉其他非 Rails Ruby 项目时,无论出于何种原因,这些项目都没有走捆绑路线,宝石集是一个很棒的东西。我还发现宝石组在开发宝石时非常有价值。很高兴有多个测试环境可以在之间切换并测试新构建的 gem。

据我所知,乘客没有阅读.rvmrc。据我所知,你不能在不同的红宝石下运行乘客的不同项目。我的默认 Rails 设置在全局 gemset 中只有 bundlerrake。我让捆绑程序从那里接管并管理其余的 gems 项目,就像您所描述的那样。效果很好。

When I am dealing with legacy code or forking other non-rails ruby projects that haven't for whatever reasons gone the bundle route, gemsets are such an awesome thing to have. I also find gemsets invaluable while developing gems. Nice to have multiple test environments to switch between and test the freshly built gem.

Passenger doesn't read the .rvmrc to the best of my knowledge. You can't run different projects in passenger under different rubies to the best of my knowledge. My default rails setup has just bundler and rake in the global gemset. I let bundler take over from there and manage rest of the gems project wise just like you describe. Works pretty well.

机场等船 2024-10-19 03:49:13

如果您预计必须更改捆绑程序版本,那么您绝对应该使用 gemsets。您可以使用 gemset 来管理那些对您的 Rails 应用程序(wirble 等)并不重要的 gem。

You should definitely use gemsets if you anticipate ever having to change your bundler version. And you can use gemsets to manage gems that don't matter specifically to your Rails app (wirble etc.).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文