问题描述
有同学遇到过这种情况吗?windows下安装失败ruby版本是2.1,devkit也安装成功了c:Ruby21>geminstallcf-uaac-r--sourcehttp://rubygems.org/ERROR:Whileexecutinggem...(Gem::RemoteFetcher::FetchError)Errno::ETIMEDOUT:Aconnectionattemptfailedbecausetheconnectedpartyddnotproperlyrespondafteraperiodoftime,orestablishedconnectionfailedbecauseconnectedhosthasfailedtorespond.-connect(2)for"api.rubygems.or"port80(http://api.rubygems.org/gems/cf-uaa-lib-3.1.0.gem)c:Ruby21>geminstallcf-uaac-r--sourcehttp://rubygems.org/Fetching:cf-uaa-lib-3.1.0.gem(100%)Successfullyinstalledcf-uaa-lib-3.1.0Fetching:highline-1.6.21.gem(100%)Successfullyinstalledhighline-1.6.21Fetching:eventmachine-1.0.7.gem(100%)TemporarilyenhancingPATHtoincludeDevKit...Buildingnativeextensions.Thiscouldtakeawhile...ERROR:Errorinstallingcf-uaac:ERROR:Failedtobuildgemnativeextension.C:/Ruby21/bin/ruby.exeextconf.rbcheckingformain()in-lssl...***extconf.rbfailed***CouldnotcreateMakefileduetosomereason,probablylackofnecessarylibrariesand/orheaders.Checkthemkmf.logfileformoredetails.Youmayneedconfigurationoptions.Providedconfigurationoptions:--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:/Ruby21/bin/ruby--with-openssl-config--without-openssl-config--with-pkg-config--without-pkg-config--with-ssl-dir--without-ssl-dir--with-ssl-include--without-ssl-include=${ssl-dir}/include--with-ssl-lib--without-ssl-lib=${ssl-dir}/lib--with-ssllib--without-ssllibC:/Ruby21/lib/ruby/2.1.0/mkmf.rb:456:in`try_do':Thecompilerfailedtogenerateanexecutablefile.(RuntimeError)Youhavetoinstalldevelopmenttoolsfirst.fromC:/Ruby21/lib/ruby/2.1.0/mkmf.rb:541:in`try_link0'fromC:/Ruby21/lib/ruby/2.1.0/mkmf.rb:556:in`try_link'fromC:/Ruby21/lib/ruby/2.1.0/mkmf.rb:742:in`try_func'fromC:/Ruby21/lib/ruby/2.1.0/mkmf.rb:973:in`blockinhave_library'fromC:/Ruby21/lib/ruby/2.1.0/mkmf.rb:918:in`blockinchecking_for'fromC:/Ruby21/lib/ruby/2.1.0/mkmf.rb:351:in`block(2levels)inpostpone'fromC:/Ruby21/lib/ruby/2.1.0/mkmf.rb:321:in`open'fromC:/Ruby21/lib/ruby/2.1.0/mkmf.rb:351:in`blockinpostpone'fromC:/Ruby21/lib/ruby/2.1.0/mkmf.rb:321:in`open'fromC:/Ruby21/lib/ruby/2.1.0/mkmf.rb:347:in`postpone'fromC:/Ruby21/lib/ruby/2.1.0/mkmf.rb:917:in`checking_for'fromC:/Ruby21/lib/ruby/2.1.0/mkmf.rb:968:in`have_library'fromextconf.rb:5:in`blockincheck_libs'fromextconf.rb:5:in`each'fromextconf.rb:5:in`all?'fromextconf.rb:5:in`check_libs'fromextconf.rb:39:in`manual_ssl_config'fromextconf.rb:64:in`<main>'extconffailed,exitcode1GemfileswillremaininstalledinC:/Ruby21/lib/ruby/gems/2.1.0/gems/eventmachine-1.0.7forinspection.ResultsloggedtoC:/Ruby21/lib/ruby/gems/2.1.0/extensions/x86-mingw32/2.1.0/eventmachine-1.0.7/gem_make.out
解决方案
解决方案二:
解决方案三:
解决方案四:
c:Ruby21>geminstallcf-uaac-r--sourcehttp://rubygems.org/Fetching:cf-uaa-lib-3.1.0.gem(100%)Successfullyinstalledcf-uaa-lib-3.1.0Fetching:highline-1.6.21.gem(100%)Successfullyinstalledhighline-1.6.21Fetching:eventmachine-1.0.7.gem(100%)TemporarilyenhancingPATHtoincludeDevKit...Buildingnativeextensions.Thiscouldtakeawhile...ERROR:Errorinstallingcf-uaac:ERROR:Failedtobuildgemnativeextension.C:/Ruby21/bin/ruby.exeextconf.rbcheckingformain()in-lssl...***extconf.rbfailed***CouldnotcreateMakefiledueto60400.comsomereason,probablylackofnecessarylibrariesand/orheaders.Checkthemkmf.logfileformoredetails.Youmayneedconfigurationoptions.Providedconfigurationoptions:--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:/Ruby21/bin/ruby--with-openssl-config--without-openssl-config--with-pkg-config--without-pkg-config--with-ssl-dir--without-ssl-dir--with-ssl-include--without-ssl-include=${ssl-dir}/include--with-ssl-lib--without-ssl-lib=${ssl-dir}/lib--with-ssllib--without-ssllib