1

Windows マシンにtandelion gemをインストールしようとしていますが、何度も失敗します。

C:\Users\William>gem install dandelion --platform=ruby
Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...
ERROR:  Error installing dandelion:
ERROR: Failed to build gem native extension.

C:/Ruby22/bin/ruby.exe -r ./siteconf20150623-7568-1ikffjg.rb extconf.rb
checking for gmake... no
checking for make... yes
checking for cmake... yes
checking for pkg-config... yes
-- cmake .. -DBUILD_CLAR=OFF -DTHREADSAFE=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_C_
FLAGS=-fPIC -DCMAKE_BUILD_TYPE=RelWithDebInfo -G "Unix Makefiles"
-- C:\DevKit\bin/make.exe
checking for main() in -lgit2... *** 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:/Ruby22/bin/$(RUBY_BASE_NAME)
--use-system-libraries
--with-git2-dir
--without-git2-dir
--with-git2-include
--without-git2-include=${git2-dir}/include
--with-git2-lib
--without-git2-lib=${git2-dir}/lib
--with-git2lib
--without-git2lib
C:/Ruby22/lib/ruby/2.2.0/mkmf.rb:456:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from C:/Ruby22/lib/ruby/2.2.0/mkmf.rb:541:in `try_link0'
from C:/Ruby22/lib/ruby/2.2.0/mkmf.rb:556:in `try_link'
from C:/Ruby22/lib/ruby/2.2.0/mkmf.rb:735:in `try_func'
from C:/Ruby22/lib/ruby/2.2.0/mkmf.rb:966:in `block in have_library'
from C:/Ruby22/lib/ruby/2.2.0/mkmf.rb:911:in `block in checking_for'
from C:/Ruby22/lib/ruby/2.2.0/mkmf.rb:351:in `block (2 levels) in postpone'
from C:/Ruby22/lib/ruby/2.2.0/mkmf.rb:321:in `open'
from C:/Ruby22/lib/ruby/2.2.0/mkmf.rb:351:in `block in postpone'
from C:/Ruby22/lib/ruby/2.2.0/mkmf.rb:321:in `open'
from C:/Ruby22/lib/ruby/2.2.0/mkmf.rb:347:in `postpone'
from C:/Ruby22/lib/ruby/2.2.0/mkmf.rb:910:in `checking_for'
from C:/Ruby22/lib/ruby/2.2.0/mkmf.rb:961:in `have_library'
from extconf.rb:89:in `<main>'

extconf failed, exit code 1

Gem files will remain installed in C:/Ruby22/lib/ruby/gems/2.2.0/gems/rugged-0.2
2.1b1 for inspection.
Results logged to C:/Ruby22/lib/ruby/gems/2.2.0/extensions/x86-mingw32/2.2.0/rug
ged-0.22.1b1/gem_make.out

「最初に開発ツールをインストールする必要があります」というエラーは頭を悩ませます。すでに DevKit をインストールしています。

このエラーを解決する方法はありますか?

4

1 に答える 1

0

これは楽しいものです。私は大げさな推測をして、あなたのバージョンがlibgit2にありC:/Program Files (x86)/libgit2/lib、そのフォルダーが何らかの形であなたPathの環境変数または他の環境変数にあると言うつもりです。

修正は、そのフォルダーが存在する可能性のある環境変数からそのフォルダーを取得することです。これにより、ruggedビルドが正しく行われるはずです。

問題

がライブラリgccをテストしようとすると、にある可能性があり、を使用している可能性があることがわかります。libgit2C:/Program Files (x86)/libgit2/lib-LC:/Program Files (x86)/libgit2/lib

問題は、適切にエスケープされていないことです。

gcc: error: Files: No such file or directory
gcc: error: (x86)/libgit2/lib: No such file or directory

これは、スペースが含まれるフォルダーに Ruby をインストールできないのと同じ理由です。

補足としてcmake、通常の DevKit に加えて、pkg-configどこかにインストールされていることを指摘したいと思います。Path

于 2015-06-24T16:01:58.443 に答える