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?
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 /*
-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
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.