3

I've been trying to install heroku. When I run curl https://cli-assets.heroku.com/install.sh | sh on terminal I get this message : 'Your path is missing /usr/local/bin, you need to add this to use this installer.'.

I've already tried to add this to $PATH, but I'm not sure if I did it correctly. When I run echo $PATH this is what I get : '/home/rasklow/usr/local/bin:/home/rasklow/.rbenv/shims:/home/rasklow/.rbenv/bin:/home/rasklow/.rbenv/shims:/home/rasklow/.rbenv/bin:/sbin:/bin:/usr/sbin:/usr/bin:**/usr/local/bin**:/snap/bin.

Now /usr/local/bin appears to be in there, so I don't how else to install heroku. I've tried to download directly the tar.gz file but I'm fairly new to linux and I don't know how to install the package correctly.

Rasklow
  • 51
  • 4
  • 1
    It looks like you wrapped `/usr/local/bin/` in **. Try removing the asterisks from the path and try again. I.e. your path should end something like this: `/usr/bin:/usr/local/bin:/snap/bin` – davejagoda Nov 29 '18 at 06:07
  • 2
    Another approach: since it looks like `/snap/bin` is already in your path, you may be able to use the snap based install: `sudo snap install --classic heroku` – davejagoda Nov 29 '18 at 06:15

4 Answers4

2

As suggested in the comments

Another approach: since it looks like /snap/bin is already in your path, you may be able to use the snap based install: sudo snap install --classic heroku - davejagoda

The snap based install worked

Rob
  • 26,989
  • 16
  • 82
  • 98
Rasklow
  • 51
  • 4
  • Good to hear. Please try to accept your own answer. Link to Heroku docs is here: https://devcenter.heroku.com/articles/heroku-cli#download-and-install – davejagoda Nov 29 '18 at 15:45
  • I ran into another configuration hell trying to get snap to work. The path /usr/local/bin exists, so the error if faulty. Searched all over - no solution to this problem, so appears Heroku is as bad as when I tried it years ago. Back to the VPS. – JosephK May 13 '19 at 06:01
2

The easiest way to fix this issue is to sudo to root: sudo su -

And then do the install: curl https://cli-assets.heroku.com/install.sh | sh

All of the checks will pass and no changes will need to be made. After installation, exit out of root.

Sixty4Bit
  • 12,852
  • 13
  • 48
  • 62
0

This is probably more like a workaround/a hack. I had the same issue on open-SUSE 15.1. When I echoed the path it showed that "/usr/local/bin/" was available on the path but still installation halted. What I did was manually adding it on the bashrc of the local user account. Basically on my .bashrc, I added this line

export PATH=$PATH:/usr/local/bin

So far everything still works, so I'm just leaving it there

allthings dev
  • 43
  • 1
  • 8
0

Another hack which worked for me (On Amazon Linux 2) was to download the install script and after verifying that /user/local/bin was added to the path, I commented out the check in the script (lines 20-23 in the version as of 2/8/22) and then ran the script:

Step 1: download script: curl https://cli-assets.heroku.com/install.sh > ./install_heroku.sh

Step 2: add /usr/bin/local to path: export PATH=$PATH:/usr/bin/local

Step 3: Comment out the if statement on lines 20-23 of the install script (just add # to the beginning of each line)

Step 4: Run cat ./install_heroku.sh | sudo sh

WebDev
  • 384
  • 1
  • 2
  • 12