这些Ruby版本中是否存在heroku命令?

Ser*_*kyy 7 ruby macos ruby-on-rails heroku heroku-toolbelt

用rbenv更新我的Ruby版本后,我无法使用Heroku命令行工具.我收到了这个错误:

> heroku
rbenv: heroku: command not found

The `heroku' command exists in these Ruby versions:
  2.0.0-p195
Run Code Online (Sandbox Code Playgroud)

从toolbelt.heroku.com重新安装工具带没有帮助.

Ser*_*kyy 9

我切换到我之前的Ruby版本2.0.0p195并卸载了gem'heroku'

rbenv global 2.0.0p195

gem uninstall heroku
Run Code Online (Sandbox Code Playgroud)

然后我切换到最新的Ruby版本2.0.0p353并重新安装了Toolbelt toolbelt.heroku.com

rbenv global 2.0.0p353
Run Code Online (Sandbox Code Playgroud)

  • 这个.圣球让我对这个问题感到非常沮丧.谢谢! (2认同)

Jan*_*imo 7

如果您正在使用rbenv,请按照以下步骤解决此问题.

错误

rbenv: heroku: command not found

The `heroku' command exists in these Ruby versions:
  2.2.2
Run Code Online (Sandbox Code Playgroud)

该怎么办

  1. rbenv local 2.2.2
  2. gem uninstall heroku
  3. rbenv rehash

很高兴去!