Rbenv 和 Heroku 客户端的两个版本

发布于 2024-12-22 12:42:51 字数 889 浏览 3 评论 0原文

我有一个相当棘手的问题,我似乎无法弄清楚。我刚刚从 rvm 切换到 rbenv,现在 Heroku 客户端出现问题。

基本上,系统中存在一个旧版本的 Heroku,而 rbenv 不知道它,但它会覆盖我安装的任何较新版本的 Heroku 客户端。这是一个问题,因为我需要新版本的 Heroku cli 来运行 cedar 命令...

以下是我的 shell 中发生的情况的示例:

~  » gem uninstall heroku
INFO:  gem "heroku" is not installed
~  » which heroku
heroku: aliased to nocorrect heroku
~  » rbenv which heroku
rbenv: heroku: command not found
~  » gem install heroku  
Fetching: heroku-2.17.0.gem (100%)
Successfully installed heroku-2.17.0
1 gem installed
~  » which heroku
heroku: aliased to nocorrect heroku
~  » heroku version
heroku-gem/1.12.1
~  » rbenv which heroku
/Users/Andrew/.rbenv/versions/1.9.2-p290/bin/heroku
~  » gem list heroku

*** LOCAL GEMS ***

heroku (2.17.0)
~  » heroku version
heroku-gem/1.12.1
~  » 

我不知道旧版本的 Heroku 在哪里,如何摆脱它,或者(最重要的是)为什么它在我的系统中徘徊并覆盖特定于 rbenv 的较新 gem。

有什么建议吗?

I've got a fairly pesky problem I can't seem to get to the bottom of. I just switched from rvm to rbenv, and now I'm having a problem with the Heroku client.

Basically, there's an old version of Heroku living somewhere in the system and rbenv is not aware of it, but it is overriding any newer version of the heroku client I install. This is a problem because I need the new version of the heroku cli to run cedar commands...

Here's and example from my shell of what's going on:

~  » gem uninstall heroku
INFO:  gem "heroku" is not installed
~  » which heroku
heroku: aliased to nocorrect heroku
~  » rbenv which heroku
rbenv: heroku: command not found
~  » gem install heroku  
Fetching: heroku-2.17.0.gem (100%)
Successfully installed heroku-2.17.0
1 gem installed
~  » which heroku
heroku: aliased to nocorrect heroku
~  » heroku version
heroku-gem/1.12.1
~  » rbenv which heroku
/Users/Andrew/.rbenv/versions/1.9.2-p290/bin/heroku
~  » gem list heroku

*** LOCAL GEMS ***

heroku (2.17.0)
~  » heroku version
heroku-gem/1.12.1
~  » 

I don't know where the old version of Heroku is, how to get rid of it, or (most importantly) why it is lingering in my system and overriding the rbenv-specific newer gem.

Any suggestions?

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

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

发布评论

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

评论(1

月野兔 2024-12-29 12:42:51

好吧,我花了一段时间,但我能够追踪到这一点。事实证明,我很久以前就使用过heroku gem(在我使用RVM之前),虽然RVM一直隐藏着旧的gem,但RBENV却没有。我发现这个使用:

sudo find / -type d -name "*heroku*"

这表明我在系统 ruby​​ 文件夹中有一些旧的宝石:

Library/Ruby/Gems/1.8/...

我清除了该文件夹下的所有子文件夹,这解决了我的问题。

Well, it took me a while but I was able to track this down. It turns out that I had used the heroku gem a long time ago (before I was even using RVM), and while RVM had been hiding the old gem, RBENV did not. I found this using:

sudo find / -type d -name "*heroku*"

This revealed that I had some old gems living in the system ruby folder:

Library/Ruby/Gems/1.8/...

I cleaned out all the subfolders under that, and that fixed my problem.

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