当我从 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/