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

前端 未结 6 1471
死守一世寂寞
死守一世寂寞 2021-01-17 14:38

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

A

相关标签:
6条回答
  • 2021-01-17 15:19

    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.

    0 讨论(0)
  • 2021-01-17 15:20

    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).

    0 讨论(0)
  • 2021-01-17 15:30

    -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

    0 讨论(0)
  • 2021-01-17 15:36

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

    0 讨论(0)
  • 2021-01-17 15:39

    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.

    0 讨论(0)
  • 2021-01-17 15:41
    brew install wget
    wget -qO- https://toolbelt.heroku.com/install.sh | sh
    
    0 讨论(0)
提交回复
热议问题