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 \”?> .....