Kyle Decot
Kyle Decot

Reputation: 20835

-bash: /usr/local/bin/heroku: /usr/local/bin/ruby: bad interpreter: No such file or directory

Whenever I open a new terminal window I now get:

-bash: /usr/local/bin/heroku: /usr/local/bin/ruby: bad interpreter: No such file or directory

Any idea as to why this is happening and how to get rid of it?

Upvotes: 11

Views: 11595

Answers (6)

Tim
Tim

Reputation: 111

I was running "pod init" in a directory. This gave me a similar error:

 -bash: /usr/local/bin/pod: /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby: bad interpreter: No such file or directory

Solution: install Cocoapods following the directions on their website.

Upvotes: 0

Cleverlemming
Cleverlemming

Reputation: 1370

I had a similar problem which resulted in the following error message when I tried to run any heroku commands:

(~/).gem/ruby/1.8/bin/heroku: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby: bad interpreter: No such file or directory

After some searching, I found a copy of the heroku-api gem in ~/.gem/ruby/1.8/cache. Deleting it and deleting the rubygems reference file in ~/.gem/ruby/1.8/bin solved the problem.

Upvotes: 0

shenlu89
shenlu89

Reputation: 17

-bash: /usr/local/bin/heroku: /usr/local/bin/ruby: bad interpreter: No such file or directory

You should firstly read the massage that the terminal throw out. /usr/local/bin/ruby: bad interpreter: No such file or directory that means there is no valid ruby command in the /usr/local/bin. So if you have install ruby but in another directory. You can use ln -s to link the /usr/local/bin/ directory. So find it out, such as /usr/bin/ruby. You can get into/usr/local/bin/directory run ln -s /usr/bin/ruby. If you have not started installing ruby, you should install it and make sure the ruby command in the /usr/local/bin directory

Upvotes: 1

Bruno
Bruno

Reputation: 6469

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

Upvotes: 2

uzsolt
uzsolt

Reputation: 6037

How did you install heroku? If from source, you should recompile with proper directories.

You can edit /usr/local/bin/heroku but I think better when you recompile it (who knows where are more bad settings in heroku).

Upvotes: 0

chown
chown

Reputation: 52798

Make sure the first line of the file /usr/local/bin/heroku is #!/path/to/ruby. You may need to change it from /usr/local/bin/ruby to /usr/bin/ruby, or if you cannot find the ruby executable, type which ruby or updatedb && locate ruby to find it.


If the above doesn't work...

Check your ~/.bashrc, ~/.inputrc~, /etc/bashrc, /etc/inputrc, /etc/profile for a line trying to execute /usr/local/bin/heroku.

Another idea is you might have this as one of your startup programs. Check in /etc/inittab for a line with /usr/local/bin/heroku.

If you still cannot find that line in any of those files you can run grep -iH heroku /*

Upvotes: 16

Related Questions