-bash: /usr/local/bin/heroku: /usr/local/bin/ruby: 错误的解释器: 没有这样的文件或目录

发布于 2024-12-11 23:21:27 字数 172 浏览 0 评论 0原文

每当我打开一个新的终端窗口时,我现在得到:

-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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

街道布景 2024-12-18 23:21:28

确保文件 /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 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 /*

温馨耳语 2024-12-18 23:21:28
brew install wget
wget -qO- https://toolbelt.heroku.com/install.sh | sh
brew install wget
wget -qO- https://toolbelt.heroku.com/install.sh | sh
桜花祭 2024-12-18 23:21:28

-bash: /usr/local/bin/heroku: /usr/local/bin/ruby: 错误的解释器:没有这样的文件或目录

您应该首先阅读终端抛出的消息。 /usr/local/bin/ruby:错误解释器:没有这样的文件或目录,这意味着 /usr/local/bin 中没有有效的 ruby 命令。因此,如果您已经安装了 ruby​​ 但在另一个目录中。您可以使用 ln -s 链接 /usr/local/bin/ 目录。所以找出来,比如/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 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

染柒℉ 2024-12-18 23:21:28

你是如何安装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).

勿忘初心 2024-12-18 23:21:28

当我尝试运行任何heroku命令时,我遇到了类似的问题,导致出现以下错误消息:

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

经过一番搜索,我在〜/.gem/ruby/1.8/cache中找到了heroku-api gem的副本。删除它并删除 ~/.gem/ruby/1.8/bin 中的 ruby​​gems 参考文件解决了问题。

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.

天气好吗我好吗 2024-12-18 23:21:28

我在目录中运行“pod init”。这给了我一个类似的错误:

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

解决方案:按照 Cocoapods 网站上的说明安装 Cocoapods。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文