windows - 从 Git Bash 运行 Ruby 时出现 "Bad Interpreter: No Medium"错误

标签 windows ruby bash cygwin

当我从 Git Bash 运行 rake/gem 时,我看到此错误。有谁知道这是什么意思吗?

sh.exe": /c/Ruby/bin/gem: D:/Users/Luis/projects/oss/oci/installer2-trunk/ruby/bin/ruby.exe^M: bad interpreter: no medium

在 Windows/Cygwin 下运行 - 特别是在 Git Bash shell 中。

最佳答案

感谢这个网站:http://www.liquidfish.net/2009/04/ruby-and-git-bash-woes.htm

事实证明 - c:\ruby\bin\gem 和 c:\ruby\bin\rake 在文件顶部的 shebang 中都有一个奇怪的路径。

我删除了整行并将其替换为

#!ruby.exe

两者都工作得很好。

仅供引用,这是可行的,因为我的系统路径中有 ruby​​.exe 的路径 - 如果没有,我就必须使用

#!(path to ruby.exe)/ruby.exe

关于windows - 从 Git Bash 运行 Ruby 时出现 "Bad Interpreter: No Medium"错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/835865/

相关文章:

windows - Powershell 脚本 : Can't read return value of executed program

c - 如何向从 SYSTEM 帐户登录的用户显示消息框?

无法读取 bash 行生成的文件

windows - 获取 "netsh dhcp server ..."命令的输出

windows - UWP map 控制 : distinction between user- and app-manipulation

ruby - Rakefile 和 Gemfile

ruby-on-rails - 我应该如何处理我的 Controller 和 View 所依赖的 Rails 模型记录?

ruby-on-rails - 如何在 IntelliJ IDEA 中设置 ruby​​ SDK?

bash - 如何使用 Bash 调用 redis-cli get?

java.lang.NoClassDefFoundError : com/sun/istack/Pool