更新 ruby​​gems 后如何保留已安装的 gem?

发布于 2024-09-18 15:58:55 字数 549 浏览 1 评论 0原文

最近重新安装 Ubuntu 后,我重新安装了 RubyGems。 Ubuntu 存储库获取了 1.3.5 版本。后来我发现我需要最新版本。因此我安装了 RubyGems 更新以达到版本 1.3.7。

问题是,升级时 gem list 仅返回我最初安装的所有 gem 的一小部分。过去,我通过在升级后重新安装所有 gem 来解决这个问题,但这很麻烦,我希望现在和将来避免这种解决方法。

我尝试将 export GEM_HOME 添加到我的 .bashrc 文件中。它不起作用。 gem list 仍然没有列出我的所有 gem(尽管我可以在我的计算机上的 /var/lib/gems/1.8/gems 中找到它们。我还创建了一个.gemrc yaml 文件并设置 gemhome 路径当我运行 gem env 时,我可以看到主路径已设置,但仍然>gem list 没有返回所有内容,

这是怎么回事?

After a recent reinstallation of Ubuntu, I reinstalled RubyGems. The Ubuntu repository grabbed version 1.3.5. Later I found I need the latest version. So I installed the RubyGems update to get to version 1.3.7.

The trouble is, upon upgrading gem list returns only a small subset of all my originally installed gems. In the past, I've solved this by reinstalling all my gems following an upgrade, but this is troublesome and I hope to avoid this workaround now and in the future.

I tried adding an export GEM_HOME to my .bashrc file. It didn't work. gem list still doesn't list all my gems (even though I can find them on my computer in /var/lib/gems/1.8/gems. I also created a .gemrc yaml file and set the gemhome path. When I run gem env I can see that the home path is set, but still gem list doesn't return everything.

What's up with this?

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

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

发布评论

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

评论(1

〗斷ホ乔殘χμё〖 2024-09-25 15:58:55

这不会直接回答你的问题,但我们很多人使用 rvm 来管理 Ruby 和 gems。好处是它不需要我们搞乱系统的 Ruby 安装和 gem,让那些需要特定版本 Ruby 或 gem 的操作系统例程单独处理。

自从切换到 rvm 以来,我也不再在 /usr/bin/local 中安装更新版本,因为 rvm 使我可以轻松地将我的开发版本与系统分开。

调整系统宝石有很多理由,所以我不会质疑你为什么要这样做。我只是扔掉 rvm tang,因为它可能有助于解决您的需求。

This won't directly answer your question, but a lot of us use rvm to manage Ruby and gems. The benefit is it doesn't require us to mess with the system's Ruby installation and gems, leaving those alone for any OS routines needing a particular version of Ruby or a gem.

Since switching to rvm I've quit installing an updated version in /usr/bin/local too as rvm makes it so easy to keep my development versions separate from the system.

There are great reasons to tweak the system gems so I won't question why you might do so. I'm just tossing out the rvm thang as it might help solve your needs.

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