The heroku command exists in these Ruby versions?
Asked Answered
A

6

8

After I updated my Ruby version with rbenv I wasn't able to use the Heroku command-line tool. I got this error:

> heroku
rbenv: heroku: command not found

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

Reinstalling the tool belt from toolbelt.heroku.com didn't help.

Acquiesce answered 24/12, 2013 at 12:52 Comment(3)
What about the solution to accept of an answer of any? =)Napoli
Possible duplicate of The `heroku' command exists in these Ruby versions:Quyenr
I wonder how a duplicate can be almost two 2 years older than the original ;)Acquiesce
A
10

I switched to my previous Ruby version 2.0.0p195 and uninstalled the gem 'heroku'

rbenv global 2.0.0p195

gem uninstall heroku

Then I switched to the latest Ruby version 2.0.0p353 and reinstalled Toolbelt toolbelt.heroku.com

rbenv global 2.0.0p353
Acquiesce answered 24/12, 2013 at 12:52 Comment(2)
This. Holy balls I was getting so frustrated by this issue. Thank you!Ullyot
After removing the heroku gem from all other versions of Ruby that rbenv had and switching back to the latest desired version using rbenv global 2.3.0 I needed to run rbenv rehash to get the toolbelt heroku command to be found.Hygiene
H
9

If you're using rbenv, here are the steps I follow to fix this.

The error

rbenv: heroku: command not found

The `heroku' command exists in these Ruby versions:
  2.2.2

What to do

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

Good to go!

Hushhush answered 2/2, 2017 at 11:20 Comment(1)
why would you need to switch to a specific version? why can't you make the executable run on your current version?Enrique
C
4

Heroku does not recommend using heroku gem from the recent times. If you have already installed the gem, uninstall the gem first with:

$ gem uninstall heroku

then install the toolbelt from Heroku as specified on Heroku site:

For ubuntu/debian:

$ wget -qO- https://toolbelt.heroku.com/install-ubuntu.sh | sh

For other linux:

$ wget -qO- https://toolbelt.heroku.com/install.sh | sh

For Windows/MacOS see instructions on links.

Chartism answered 24/12, 2013 at 12:57 Comment(2)
It was need to close it under condition if installed.Napoli
To uninstall the old versions of heroku you'll need to switch to the Ruby version that it's installed for, uninstall the gem, reinstall the Toolbelt and then change the global Ruby version back to the newer one.Ullyot
H
2

I was having a similar issue. I had the heroku gem install on various ruby versions and despite the fact I had installed the heroku toolbelt from that package downloaded from their site, I was still getting:

rbenv: heroku: command not found

I found that after I had uninstalled the gem from all my ruby versions I had to run:

rbenv rehash

After that I found that everything work perfectly. I found this out from this stackoverflow answer:

ruby - heroku: command not found

Heriot answered 15/4, 2015 at 9:23 Comment(0)
I
1

I also had this problem, if you do the following command in the terminal:

which convert

And you get back this: Users/user_name/.rbenv/shims/convert, you should remove this file in your shims.

rm Users/user_name/.rbenv/shims/convert

If you do which convert again it should give back a different url: /usr/local/bin/convert

Idem answered 3/11, 2016 at 13:45 Comment(0)
V
0

On MacOS, the thing here is that rbenv was getting confused along with brew and the heroku binary.

Heroku recommends a brew install for Macs. Now, you need to make sure that you don't have the gem installed with any other Ruby version managed with rbenv.

If you do, just reinstall them, and you'll be good to go.

Vaucluse answered 29/3, 2017 at 16:8 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.