我一直试图在我的"Ruby on Rails“应用程序上做一些简单的"rails server”,然而我正在和我的一个使用linux的朋友一起工作,我坐在windows xp (32位)上,一切都很顺利,他实现了叫做"curl“和"typhoeus”的gem,所以为了让我在我的localhost:3000上查看它,我也必须安装gem。
所以我写的是:
D:\>gem install typhoeus
Building native extensions. This could take a while...
ERROR: Error installing typhoeus:
ERROR: Failed to build gem native extension.
C:/Ruby187/bin/ruby.exe extconf.rb
checking for curl/curl.h in C:/Ruby187/lib/ruby/gems/1.8/gems/typhoeus-0.2.4/cro
ss/curl-7.19.4.win32/include... no
need libcurl
*** 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:/Ruby187/bin/ruby
Gem files will remain installed in C:/Ruby187/lib/ruby/gems/1.8/gems/typhoeus-0.
2.4 for inspection.
Results logged to C:/Ruby187/lib/ruby/gems/1.8/gems/typhoeus-0.2.4/ext/typhoeus/
gem_make.out是的,它看起来不是很漂亮,但很明显,它要求一个叫做"libcurl“的东西,所以我从互联网上下载了32位windows xp的curl版本,我把exefile和所有的dll文件放在了windows文件夹中。我尝试简单地写下"curl“,看看它是否有效。这是我得到的:
D:\>curl
curl: try 'curl --help' or 'curl --manual' for more information我又写了一次gem install typhoeus,我得到了和上面一样的错误,我遗漏了什么?libcurl没有提供curl吗?我非常需要帮助,因为我的朋友不能帮助我,因为他是linux的家伙。所以请帮帮我--告诉我要安装typhoeus必须做什么!(我还尝试编写gem install typhoeus 0.2.4,但这抛出了一些其他错误:
ERROR: Could not find a valid gem 'typhoeus-0.2.4' (>= 0) in any repository)
这是我在ruby on rails应用程序的文件夹中写的。所以我迷路了,非常需要帮助!
提前谢谢你,
哈里
发布于 2011-09-13 09:46:35
我在Windows7上遇到了类似的问题,问题出在Windows机器的extconf.rb文件中的一些逻辑上。以下行是导致need libcurl错误消息的原因:
if Config::CONFIG['target_os'] == 'mingw32'
header = File.join(ROOT, 'cross', 'curl-7.19.4.win32', 'include')
unless find_header('curl/curl.h', header)
abort "need libcurl"
endFile.join调用导致makefile查找typhoeus中未包含的目录(cross/curl-7.19.4.win32/include),因此makefile将无法工作。
我花了一天的时间在网上查看了很多解决方案(this link帮了我最大的忙),最后找到了一个变通方法,只需简单地将File.join()更改为我的curl gem的显式文件路径。我编辑了extconf.rb文件两次,一次是在这里:
if Config::CONFIG['target_os'] == 'mingw32'
header = File.join('C:\RailsInstaller\Ruby1.9.2\lib\ruby\gems\1.9.1\gems\curl-7.19.4-devel-mingw32', 'include')
unless find_header('curl/curl.h', header)
abort "need libcurl"
end这里有一次:
if Config::CONFIG['target_os'] == 'mingw32'
find_library('curl', 'curl_easy_init',
File.join('C:\RailsInstaller\Ruby1.9.2\lib\ruby\gems\1.9.1\gems\curl-7.19.4-devel-mingw32', 'bin'))我相信您可能需要安装DevKit,但我不确定。
希望这能有所帮助!
发布于 2011-06-04 07:12:02
请尝试这个分支:https://github.com/NoKarma/typhoeus/downloads我在网上找到了不同的解决方案,但只有这个有效。也许有一天,他们最终会修复它,在Windows下编译。
发布于 2011-06-05 04:44:59
RocketR提供的下载与最新版本的Typhoeus (0.2.4)不兼容。这篇关于GitHub的评论为我提供了解决方案(https://github.com/dbalatero/typhoeus/issues/11#issuecomment-309957)
less involved workaround for typhoeus
0.1.29 on ruby 1.9.1 -- just give it what it wants.
----------- checking for curl/curl.h in C:/path/to/ruby/gems/1.9.1/gems/typhoeus-0.1.29/cross/curl-7.19.4.win32/include... no need libcurl
-----------
download: http://www.gknw.de/mirror/curl/win32/old_releases/curl-7.19.4-devel-mingw32.zip
mkdir C:/path/to/ruby/gems/1.9.1/gems/typhoeus-0.1.29/cross, extract, rename to curl-7.19.4.win32
gem install typhoeus, as you would normally.https://stackoverflow.com/questions/6061800
复制相似问题