2009-07-22 79 views
2

如何在Windows XP上使用MinGW編譯和構建taf2-curb Ruby gem?如何使用MinGW在Windows XP上編譯和構建taf2-curb Ruby gem?

我試過了,但我有點釣魚,不成功。

C:\Documents and Settings\Me>gem install taf2-curb -- --with-curl-include=C:/curl-7.19.5-devel-mingw32/include 
--with-curl-dir=C:/curl-7.19.5 --with-curl-lib=C:/curl-7.19.5-devel-mingw32/lib --prefix=C:/MinGW --with-curllib 
Bulk updating Gem source index for: http://gems.rubyforge.org 
Updating metadata for 73 gems from http://gems.rubyonrails.org 
......................................................................... 
complete 
Bulk updating Gem source index for: http://gems.github.com 
Building native extensions. This could take a while... 
ERROR: Error installing taf2-curb: 
     ERROR: Failed to build gem native extension. 

C:/Ruby/bin/ruby.exe extconf.rb install taf2-curb -- --with-curl-include=C:/curl-7.19.5-devel-mingw32/include --with-cur 
l-dir=C:/curl-7.19.5 --with-curl-lib=C:/curl-7.19.5-devel-mingw32/lib --prefix=C:/MinGW --with-curllib 
checking for curl-config... no 
checking for main() in true.lib... no 
*** 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 
     --srcdir=. 
     --curdir 
     --ruby=C:/Ruby/bin/ruby 
     --with-curl-dir 
     --with-curl-include=${curl-dir}/include 
     --with-curl-lib=${curl-dir}/lib 
     --with-curllib 
extconf.rb:9: Can't find libcurl or curl/curl.h (RuntimeError) 

    Try passing --with-curl-dir or --with-curl-lib and --with-curl-include 
    options to extconf. 


Gem files will remain installed in C:/Ruby/lib/ruby/gems/1.8/gems/taf2-curb-0.4.8.0 for inspection. 
Results logged to C:/Ruby/lib/ruby/gems/1.8/gems/taf2-curb-0.4.8.0/ext/gem_make.out 

C:\Documents and Settings\Me>

我已經安裝了捲曲7.19.5和捲曲7.19.5-devel的-MinGW的從這個網址: http://curl.haxx.se/download.html

幫助!

並且謝謝!

回答

0

你會想檢查你的mkmf.log 也許你的路徑中添加了curb-config? -r

1

這裏是我的解決方案:

  1. 首先你需要這個傢伙:
    https://github.com/oneclick/rubyinstaller/wiki/Development-Kit
    希望你能閱讀,並安裝裝配,重新安裝與rubyinstaller你的紅寶石。

  2. 下載二進制libcurl for win32。
    將libcurl_imp.lib從%LIBCURL%複製到%RUBY%\ lib(hack,沒有時間弄清楚操作方法)
    將%LIBCURL%\ lib \ Release \ curllib_static.lib複製並重命名爲%RUBY% \ LIB \ curl.lib(同一黑客)

  3. 骶部分
    創業板安裝TAF2路邊--platform =紅寶石 - --with捲曲-DIR =%的libcurl%
    你有mutch錯誤辯論,因爲邪惡不睡覺,但不要擔心,聖戰就在這裏。

  4. 現在是extrimelly小心
    轉到%RUBY%\ LIB \紅寶石\寶石\ 1.9.1 \寶石\ TAF2路邊-0.5.4.0 \分機
    邪惡坐落在2個文件:curb_easy.h和curb_easy .c
    使用查找和替換功能在您最喜愛的編輯器中打開它們。
    發現邪惡的每個條目:接口,除了literall的 「接口...」 並小心地更換到
    interface_wtf_ms_i_love_bgates
    開放Makefile中,添加有-llibcurl_imp串

LIBS = $(LIBRUBYARG_SHARED )-lcurl -lshell32 -lws2_32 -llibcurl_imp

現在我想你已經準備好了,在ext中運行devkitvars.bat,然後運行make。
你必須得到curb_core.so在寶石的外部目錄。

此後需要手動更改gemspec
c:... \ lib \ ruby​​ \ gems \ 1.9.1 \ gems \ taf2-curb-0.5.4.0> gem spec .... \ cache/taf2-curb -0.5.4.0.gem --ruby> .... \ specifications/taf2-curb-0.5.4.0。現在gemspec

寶石列表將顯示你TAF2路邊安裝

這裏是所有這些東西證明:
恆im_mtf_spamma_yes_i_am你可以找到它在github上feedtosis頁值
C:\ TEST3>軌控制檯
加載開發環境(滑軌3.0.3)
IRB(主):001:0>客戶= Feedtosis :: Client.new( 'im_mtf_spamma_yes_i_am')
=>#{},:命名空間=>「feedtosi
s「,:retained_digest_size => 10},@ backend = {}>
IRB(主):002:0>結果= client.fetch
=>#
IRB(主):004:0> result.perform
=>真
IRB(主):005:0 > result.body_str
=>「\ r \ n s2full.xsl \」?> .....

相關問題