无法安装gem(tar:无法连接到C:解析失败)

尝试安装gem时,我收到此错误:

C:\WINDOWS\system32>gem install sqlint Temporarily enhancing PATH for MSYS/MINGW... Building native extensions. This could take a while... ERROR: Error installing sqlint: ERROR: Failed to build gem native extension. current directory: C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/pg_query-0.9.2/ext/pg_query C:/Ruby24-x64/bin/ruby.exe -r ./siteconf20170810-19576-j7fs2b.rb extconf.rb tar: Cannot connect to C: resolve failed *** extconf.rb failed *** Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. You may need configuration options. Provided configuration options: --with-opt-dir --without-opt-dir --with-opt-include --without-opt-include=${opt-dir}/include --with-opt-lib --without-opt-lib=${opt-dir}/lib --with-make-prog --without-make-prog --srcdir=. --curdir --ruby=C:/Ruby24-x64/bin/$(RUBY_BASE_NAME) extconf.rb:22:in `': ERROR (RuntimeError) extconf failed, exit code 1 Gem files will remain installed in C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/pg_query-0.9.2 for inspection. Results logged to C:/Ruby24-x64/lib/ruby/gems/2.4.0/extensions/x64-mingw32/2.4.0/pg_query-0.9.2/gem_make.out 

我可以从下面的post中看出它与tar不喜欢有关:在本地路径名中。 (将它们误认为是远程路径名,并且无法连接)

使用Chef Knife的Windows命令行tar“无法连接到d:resolve failed”

然而,那里给出的答案没有帮助修复gem 。 如果我遵循从rubygems.org下载的整个依赖树并安装每个单独的组件(首先是依赖项),它似乎确实正确安装。 但是,每次我想安装1个gem时,尝试这样做都会是一个非常缓慢的过程。

我的问题:我怎样才能在Windows上安装gem而不会误认为远程路径的本地路径?


附加信息:

  • 默认情况下,Git Bash安装了linux等效的覆盖Windows命令。 (目前还不知道如何恢复这个,所以我不确定这是否是一个因素)
  • gem版本:2.6.12
  • Ruby版本:2.4.1p111(2017-03-22修订版58053)[x64-mingw32]
  • 我正在使用Windows 10 Home