The `heroku' command exists in these Ruby versions:
Asked Answered
E

2

3

I'm having major issues with the heroku toolbelt. I'm using the cedar 14 stack and when I am trying to use a ruby version that isn't ruby 2.0.0-dev I get this error.

rbenv: heroku: command not found

The `heroku' command exists in these Ruby versions:
  2.0.0-dev

I need heroku to be working with ruby 1.9.3 and I don't think cedar 14 supports that version of ruby. Can someone explain first, why I am only allowed to use heroku with ruby 2.0.0-dev and also how I can install a older stack that supports ruby 1.9.3?

Etti answered 4/12, 2015 at 16:33 Comment(0)
D
16

The problem is that there are two heroku executables on your system: one in system paths such as /usr/local/bin/heroku (provided by Toolbelt), and one in rbenv's shims because Ruby 2.0.0-dev had "heroku" gem installed.

Because rbenv's shims directory usually have higher precedence, it will block invocation from ever executing the heroku executable provided by Toolbelt.

The solution is to uninstall any instance of "heroku" gem and relying solely on Toolbelt for all heroku usage on the command line:

for v in `rbenv whence heroku`; do RBENV_VERSION=$v gem uni heroku -ax; done
rbenv rehash
which heroku
Delinda answered 24/12, 2015 at 22:29 Comment(1)
The solution didn't work for me, but the explanation on the two hero executables did. And I searched and found the tip -- https://mcmap.net/q/236096/-how-do-you-uninstall-rbenv-on-macos -- and followed the instructions to remove rbenv, and heroku now works! Thank you!Wildon
F
0

You can use 1.9.3 on the cedar stack according to this. The heroku toolbelt is installed as a executable not a ruby gem. How are you trying to execute the command? You should be able to use it from the terminal such as heroku run rake db:migrate etc.

Frayne answered 4/12, 2015 at 19:18 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.