Heroku command not found

Multi tool use


Heroku command not found
After installing Heroku Toolbelt, in terminal on Mac when trying to run the following command:
heroku
I get the error:
bash: heroku: command not found
When I do:
gem environment
I get:
- RUBYGEMS VERSION: 1.3.6
- RUBY VERSION: 1.8.7 (2012-02-08 patchlevel 358) [universal-darwin11.0]
- INSTALLATION DIRECTORY: /Library/Ruby/Gems/1.8
- RUBY EXECUTABLE: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
- EXECUTABLE DIRECTORY: /usr/bin
- RUBYGEMS PLATFORMS:
- ruby
- universal-darwin-11
- GEM PATHS:
- /Library/Ruby/Gems/1.8
- /Users/Bart/.gem/ruby/1.8
- /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://rubygems.org/
I've tried adding several paths to $PATH, but nothing works...
source ~/.bashrc
source ~/.bash_profile
Exact same thing is happening to me. I'm on OSX 10.8.1
– Matt Bridges
Oct 9 '12 at 13:44
At the bottom of toolbelt.heroku.com it says "The heroku command line client will be installed into /usr/local/heroku and the executable will be symlinked as /usr/bin/heroku." For me, /usr/bin/heroku does not exist after running the installer. Is it there for you?
– Matt Bridges
Oct 9 '12 at 14:21
@pjam I get the error: "bash: /Users/Bart/.bashrc: No such file or directory"
– bart
Oct 9 '12 at 15:42
@MattBridges Does not seem to exist (or I used the wrong command): "bash: cd: /usr/bin/heroku/: No such file or directory"
– bart
Oct 9 '12 at 15:43
7 Answers
7
Manually adding the symlink after installing Toolbelt fixed it for me.
sudo ln -s /usr/local/heroku/bin/heroku /usr/bin/heroku
sudo ln -s /usr/local/heroku/bin/heroku /usr/bin/heroku
This fixed it for me on Mountain Lion. One person on Twitter reported that the install just worked for them on Mountain Lion. Another reported that they had to create the symlink manually in Linux.
– Aral Balkan
Oct 12 '12 at 11:40
This fixed me on debian squeeze.
– eeeeeean
Oct 19 '12 at 21:13
Sorted it for me on Mac 10.8.1!
– phil
Oct 23 '12 at 14:30
Thanks! that fixed my Ubuntu 12.10
– Guy Korland
Oct 25 '12 at 15:48
On 10.9.2 this worked, but I had to change it to:
sudo ln -s /usr/local/heroku/bin/heroku /usr/local/bin/heroku
– Jason Preston
Apr 20 '15 at 17:38
sudo ln -s /usr/local/heroku/bin/heroku /usr/local/bin/heroku
Just run
$ gem install heroku
Form your app that's it.
It's solution for Os X
– Shravan40
Dec 2 '15 at 20:14
Do remember to actually source the installation file.
wget -0- wget https://toolbelt.heroku.com/install-ubuntu.sh | sh
didn't work for me. And as a linux noob I used instead:
wget 0- wget https://toolbelt.heroku.com/install-ubuntu.sh | sh
notice that the '-' is missing from the option to wget
. This downloaded the install source to my current directory.
wget
then I did:
bash install-ubuntu.sh
which finished up the installation for me.
then:
heroku login
works!!
This solved my issue on Ubuntu 14.04. I've done wget -O- toolbelt.heroku.com/install-ubuntu.sh | sh as it said in the documentation but couldn't use "heroku login" Thanks.
– ssudaraka
Sep 1 '16 at 7:12
First install heroku:
wget -qO- https://toolbelt.heroku.com/install.sh | bash
After that add a symlink to binary like @Garrett did:
sudo ln -s /usr/local/heroku/bin/heroku /usr/bin/heroku
After installing Heroku Toolbelt using the .pkg file I downloaded from Heroku's Getting Started with Rails 4.x on Heroku page, I got the heroku command not found message
. My /usr/local/heroku/bin
folder did exist.
heroku command not found message
/usr/local/heroku/bin
I was able to resolve this issue by going to https://toolbelt.heroku.com and downloading the same .pkg file from that site and re-installing it. Note, I did not uninstall the previous package first.
After you run wget -0- wget https://toolbelt.heroku.com/install-ubuntu.sh | sh
you might get the following warning:
wget -0- wget https://toolbelt.heroku.com/install-ubuntu.sh | sh
WARNING: The following packages cannot be authenticated!
heroku heroku-toolbelt
If this happens, run this apt-get install -y --force-yes heroku-toolbelt
apt-get install -y --force-yes heroku-toolbelt
I've run all the commands with sudo, but I don't know if it makes a difference. Thanks to this answer
(This answer is for typical other persons, that may land here, and that may find it useful)
If you come to install heroku snap using snap
command through the command line as follow sudo snap install heroku --classic
(the thing you will find in the heroku doc).
And that after installation the heroku command isn't available. Then here the solution and the why:
snap
sudo snap install heroku --classic
First know that when you install a new snap, it get added to /snap folder. A new folder with the snap name is created (/snap/heroku), and the executable file for the command is added to /snap/bin (/snap/bin/heroku).
Try
/snap/bin/heroku help
and you will find it work very well.
Solution: So you have just to add /snap/bin to your PATH environement variable.
Heroku is supposing that it's already done. I don't know, if that should have been done automatically at the installation of snapd package. But any way, that's it.
For how to add new paths to the PATH environment variable look at the links bellow, to get a good idea (case you don't know that already):
Here an example:
sudo nano /etc/environment
i chose to add the path through /etc/environment (remember you can't use shell commands).
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/node-v9.6.1-linux-x64/bin:/snap/bin
You can see i add it at the end (that simple).
Here another example doing it in /etc/profile:
if [ "`id -u`" -eq 0 ]; then
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
else
PATH="/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games"
fi
PATH="$PATH:/snap/bin"
export PATH
I just added one line (the one before the last, and note that a portion from the whole file (/etc/profile)).
There is different ways to add to PATH, even an infinity of ways if we give our imagination a go. The difference between the ways is about when it get set, and executed, and what scope it reach. As also organization aspect (i can have my own text list (one path per line), and have it compiled and executed in the right manner and place for example). Better see the links above, i put a good selection out there, to get a better understanding about how things work, and what method to choose. But generally the two above for a system wide configuration, are mostly what you need.
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
Did you restart your shell ? Or simply run
source ~/.bashrc
orsource ~/.bash_profile
?– pjam
Oct 9 '12 at 12:05