2011-05-19 127 views
3

我一直在尝试在我的“Ruby on Rails”应用程序上做一些简单的“rails server”,但是我正在和我的一位朋友一起工作,他是使用Linux,我坐在Windows XP(32位)一切都很顺利,所有,他实现了称为“卷曲”和“typhoeus”的宝石,所以为了让我在我的本地主机上查看它:3000我必须安装宝石也是。在windows xp上安装Typhoeus on Ruby on Rails(32位)


所以这是我写的:


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 


是的它看起来不那么漂亮做的,但apparantly它要求一种叫“的libcurl “,所以我从互联网上下载了用于Windows XP 32位的curl版本,我把exe文件&所有的dll文件放在了窗口中文件夹中。我试图简单地写“卷曲”来看看它是否奏效。这是我的了:

D:\>curl 
curl: try 'curl --help' or 'curl --manual' for more information 

我写的宝石重新安装百头巨怪,我得到了同样的错误如上,我缺少什么? libcurl不卷曲吗?我迫切需要帮助,因为我的朋友不能帮助我,因为他是一个Linux人。所以请帮助我 - 告诉我必须做什么来安装Typhoeus! (我也试着写创业板安装百头巨怪-0.2.4但抛出了其他一些错误:

ERROR: Could not find a valid gem 'typhoeus-0.2.4' (>= 0) in any repository 

而且我写的,虽然on Rails应用程序的红宝石的文件夹中存在。所以我迷路了,非常需要帮助!

由于提前,
哈利

回答

1

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. 
2

我有一个类似的问题在Windows 7上,这个问题是一些逻辑,在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" 
    end 

File.join的调用导致生成文件以寻找一个目录(横/卷曲7.19.4.win32 /包括),其不包含在百头巨怪,和因此makefile将不起作用。

我在网上查看了大部分时间的大部分解决方案(this link帮助最大),并最终找到了解决方法,只需更改File.join()即可为我的卷曲宝石使用显式文件路径。我编辑了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,但我不知道。

希望这会有所帮助!

0

这不再是在Windows Vista/7上的Ruby193的问题。 只要安装百头巨怪

创业板安装百头巨怪

这给我的Vista电脑没有错误。

请确保您可以从任何地方运行curl.exe,方法是将它放在没有空格的路径中,并且位于用户或系统路径中。

在你的脚本中包含typhoeus,你就完成了。