2011-05-19 131 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,你就完成了。