-bash: /usr/local/bin/heroku: /usr/local/bin/ruby: 错误的解释器: 没有这样的文件或目录
每当我打开一个新的终端窗口时,我现在得到:
-bash: /usr/local/bin/heroku: /usr/local/bin/ruby: badterpreter: 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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
确保文件
/usr/local/bin/heroku
的第一行是#!/path/to/ruby
。您可能需要将其从/usr/local/bin/ruby
更改为/usr/bin/ruby
,或者如果您找不到ruby
> 可执行文件,输入which ruby
或updatedb &&定位 ruby
来找到它。如果上述方法不起作用...
检查您的
~/.bashrc
、~/.inputrc~
、/etc/bashrc
、< code>/etc/inputrc、/etc/profile
用于尝试执行/usr/local/bin/heroku
的行。另一个想法是您可以将其作为启动程序之一。检查
/etc/inittab
中是否有包含/usr/local/bin/heroku
的行。如果您仍然无法在任何这些文件中找到该行,您可以运行
grep -iH heroku /*
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 theruby
executable, typewhich ruby
orupdatedb && 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: 错误的解释器:没有这样的文件或目录
您应该首先阅读终端抛出的消息。
/usr/local/bin/ruby:错误解释器:没有这样的文件或目录
,这意味着/usr/local/bin 中没有有效的
。因此,如果您已经安装了 ruby 但在另一个目录中。您可以使用 ln -s 链接 /usr/local/bin/ 目录。所以找出来,比如ruby
命令/usr/bin/ruby
。你可以进入/usr/local/bin/
目录运行ln -s /usr/bin/ruby
。如果您还没有开始安装ruby
,您应该安装它并确保ruby
命令位于/usr/local/bin
目录中-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 validruby
command in the/usr/local/bin
. So if you have installruby
but in another directory. You can useln -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 runln -s /usr/bin/ruby
. If you have not started installingruby
, you should install it and make sure theruby
command in the/usr/local/bin
directory你是如何安装heroku的?如果来自源代码,您应该使用正确的目录重新编译。
您可以编辑
/usr/local/bin/heroku
但我认为重新编译它会更好(谁知道heroku 中哪里有更糟糕的设置)。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).当我尝试运行任何heroku命令时,我遇到了类似的问题,导致出现以下错误消息:
经过一番搜索,我在〜/.gem/ruby/1.8/cache中找到了heroku-api gem的副本。删除它并删除 ~/.gem/ruby/1.8/bin 中的 rubygems 参考文件解决了问题。
I had a similar problem which resulted in the following error message when I tried to run any heroku commands:
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.
我在目录中运行“pod init”。这给了我一个类似的错误:
解决方案:按照 Cocoapods 网站上的说明安装 Cocoapods。
I was running "pod init" in a directory. This gave me a similar error:
Solution: install Cocoapods following the directions on their website.