我正在尝试使用 libcurl 在 Windows 7 上安装遏制 gem,但它返回错误。这是为了最终目的是在带有 vagrant 的 vm 上运行 ruby 应用程序,此处解释为github catarse install。但它返回一个错误说:
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing curb:
ERROR: Failed to build gem native extension.
C:/RailsInstaller/Ruby1.9.3/bin/ruby.exe extconf.rb
C:/RailsInstaller/Ruby1.9.3/bin/ruby.exe: invalid option -V (-h will show valid
options) (RuntimeError)
这些是我用过的版本:
C:\>ruby -v
ruby 1.9.3p392 (2013-02-22) [i386-mingw32]
C:\>gem -v
2.0.3
C:\>vagrant -v
Vagrant version 1.2.2
所以我尝试使用http://beginrescue.blogspot.com.au/2010/07/installing-curb-with-ruby-191-in.html但出现错误并且 make_gem.out 文件有很多这些(例如,我认为没有必要发布整个文件):
最佳:
C:/RailsInstaller/Ruby1.9.3/bin/ruby.exe extconf.rb --with-curl-lib=C:\curl-7.30.0-devel-mingw32\bin --with-curl-include=C:\curl-7.30.0-devel-mingw32\include
checking for curl-config... no
checking for main() in -lcurl... yes
checking for curl/curl.h... yes
底部:
C:\RailsInstaller\Ruby1.9.3\lib\ruby\gems\1.9.1\gems\curb-0.8.4\ext/curb_postfield.c:454: undefined reference to `_imp__curl_free'
curb_postfield.o: In function `append_to_form':
C:\RailsInstaller\Ruby1.9.3\lib\ruby\gems\1.9.1\gems\curb-0.8.4\ext/curb_postfield.c:76: undefined reference to `_imp__curl_formadd'
C:\RailsInstaller\Ruby1.9.3\lib\ruby\gems\1.9.1\gems\curb-0.8.4\ext/curb_postfield.c:115: undefined reference to `_imp__curl_formadd'
C:\RailsInstaller\Ruby1.9.3\lib\ruby\gems\1.9.1\gems\curb-0.8.4\ext/curb_postfield.c:120: undefined reference to `_imp__curl_formadd'
collect2: ld returned 1 exit status
make: *** [curb_core.so] Error 1