Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

heroku commands and push giving me 'CLI is deprecated. Please reinstall' error

I have had no problem pushing to heroku, but now whenever I write a command such as:

heroku create
heroku open

git push heroku master 

It gives me this error:

$  heroku open
 ▸    heroku-cli: This CLI is deprecated. Please reinstall from
 ▸    https://cli.heroku.com

What should I do to stop this?

I have ran heroku for sites that have given me no problem before but now the error is showing. I am using the same devise and the authentication details have not changed. I also restarted the computer (it's a mac).

like image 764
Nabeel El-Habbash Avatar asked Jun 13 '17 12:06

Nabeel El-Habbash


People also ask

How do you check if heroku CLI is installed?

Open Command Prompt by right-clicking the Start Menu, choose Run, enter cmd and click OK. Now type heroku and press enter. If you receive a help message, heroku-cli was installed successfully.

How do I open heroku CLI?

After you install the CLI, run the heroku login command. Enter any key to go to your web browser to complete login. The CLI then logs you in automatically. If you'd prefer to stay in the CLI to enter your credentials, run heroku login -i .


6 Answers

For Windows users.

After installing an updated version of the cli I ended up with a 32 bit version in C:\Program Files (x86)\Heroku (called the Heroku Toolbelt - the old one), and a 64 bit version in 'C:\Program Files\Heroku' (called the Heroku CLI - the new one). Both were in my %PATH% environment variable, but the older one took precedence as it was higher up.

Resolution is either:

  1. Remove C:\Program Files (x86)\Heroku from the system environment variables

or

  1. Uninstall the heroku toolbelt
like image 28
Richard Williams Avatar answered Oct 18 '22 19:10

Richard Williams


Upgrade your heroku cli with homebrew as follows:

brew upgrade heroku

If you see Error: heroku not installed message, install it again: brew install heroku. You can also see the following output:

The formula built, but is not symlinked into /usr/local
Could not symlink bin/heroku
Target /usr/local/bin/heroku
already exists. You may want to remove it:
  rm '/usr/local/bin/heroku'

To force the link and overwrite all conflicting files:
  brew link --overwrite heroku

To list all files that would be deleted:
  brew link --overwrite --dry-run heroku

Possible conflicting files are:
/usr/local/bin/heroku -> /usr/local/heroku/bin/heroku

In this case just follow the instructions and run: brew link --overwrite heroku

Test if you still have the deprecation message, for ex.: heroku logs

Hope this helps.

like image 78
belgoros Avatar answered Oct 18 '22 18:10

belgoros


I was getting the same error and I fixed it with:

$ brew update
$ brew upgrade heroku

I hope it helps!

like image 27
ivana Avatar answered Oct 18 '22 19:10

ivana


Just because you have the CLI installed does not mean when you run heroku that it is running the newly installed version. First, run which heroku to see where the heroku binary is that you're running. If it's not /usr/local/bin/heroku you'll need to either delete that file, or edit your PATH environment variable so /usr/local/bin takes precedence.

If it is /usr/local/bin/heroku likely you need to update the symlink. If you run brew doctor it will tell you if the symlinks are not set correctly.

like image 40
Jeff Dickey Avatar answered Oct 18 '22 20:10

Jeff Dickey


All the solutions above didn't work for me as my brew wasn't compatible with OS X 10.2

If you get the following warning:

Warning: You are using OS X 10.12.
We do not provide support for this pre-release version.
You may encounter build failures or other breakages.

Here is what worked for me:

Try to update brew:

brew update

You may encounter with a new permission issue as I did:

Error: /usr/local must be writable!

If so, simply run the following:

sudo chgrp -R admin /usr/local
sudo chmod -R g+w /usr/local
brew update

Now, when you have an updated brew that is compatible with Mac OS 10.2, all you need to do is to update heroku

you can just upgrade it:

brew upgrade heroku

Or uninstall and then install it:

brew uninstall heroku
rm -rf ~/.local/share/heroku ~/.config/heroku ~/.cache/heroku
brew install heroku

To test your updated Heroku just try

heroku logs

Good luck!

like image 39
Guy Dubrovski Avatar answered Oct 18 '22 19:10

Guy Dubrovski


I had originally installed heroku as a ruby gem, so I had to run:

$ gem uninstall heroku

Then reinstall the new version from Homebrew

$ brew install heroku
like image 45
seancdavis Avatar answered Oct 18 '22 18:10

seancdavis