【发布时间】:2011-12-01 17:09:03
【问题描述】:
我最近在运行 gems 或 bundler 时开始收到此错误。 我能记得我最近改变的唯一一件事是升级我的 git 版本。
我使用 MINGW32 作为 shell,一年多来一直运行良好。
我已确保 git 在我的 PATH 中,但现在不确定接下来要查找什么。
接下来我可以做些什么来解决这个问题?
这是我得到的输出示例。此示例显示了 heroku gem,但我在运行 bundle install 时得到了相同的结果
$ heroku console
openpath: pathname too long (ignored)
Directory ""
File "chcp"
openpath: pathname too long (ignored)
Directory ""
File "git"
c:/Ruby192/lib/ruby/gems/1.9.1/gems/heroku-2.14.0/lib/heroku/helpers.rb:111:in ``': No such file or directory - git --version (Errno::ENOENT)
from c:/Ruby192/lib/ruby/gems/1.9.1/gems/heroku-2.14.0/lib/heroku/helpers.rb:111:in `has_git?'
from c:/Ruby192/lib/ruby/gems/1.9.1/gems/heroku-2.14.0/lib/heroku/helpers.rb:116:in `git'
from c:/Ruby192/lib/ruby/gems/1.9.1/gems/heroku-2.14.0/lib/heroku/command/base.rb:192:in `git_remotes'
from c:/Ruby192/lib/ruby/gems/1.9.1/gems/heroku-2.14.0/lib/heroku/command/base.rb:170:in `extract_app_in_dir'
from c:/Ruby192/lib/ruby/gems/1.9.1/gems/heroku-2.14.0/lib/heroku/command/base.rb:162:in `extract_app'
from c:/Ruby192/lib/ruby/gems/1.9.1/gems/heroku-2.14.0/lib/heroku/command/run.rb:72:in `console'
from c:/Ruby192/lib/ruby/gems/1.9.1/gems/heroku-2.14.0/lib/heroku/command.rb:114:in `run'
from c:/Ruby192/lib/ruby/gems/1.9.1/gems/heroku-2.14.0/bin/heroku:14:in `<top (required)>'
from c:/Ruby192/bin/heroku:19:in `load'
from c:/Ruby192/bin/heroku:19:in `<main>'
这是上面引用的 helpers.rb 中的第 111 行。
def has_git?
%x{ git --version } #this is 111
$?.success?
end
【问题讨论】:
-
你已经弄清楚了吗?看起来 ruby 无法运行或找不到您的 git 可执行文件。