2
votes

How do I compile and build the taf2-curb Ruby gem on Windows XP with MinGW?

I tried this, but I'm kinda fishing, unsuccessfully.

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>

I've installed curl-7.19.5 and curl-7.19.5-devel-mingw from this url: http://curl.haxx.se/download.html

Help!

And thanks!

2

2 Answers

1
votes

Here's my solution:

  1. first of all you need this guy:
    https://github.com/oneclick/rubyinstaller/wiki/Development-Kit
    hope you can read, and instal-reinstall your ruby with rubyinstaller.

  2. download binary libcurl for win32.
    copy libcurl_imp.lib from %LIBCURL% to your %RUBY%\lib (hack, have no time to figure out how-to)
    copy and rename %LIBCURL%\lib\Release\curllib_static.lib to %RUBY%\lib\curl.lib (same hack)

  3. Sacral part
    gem install taf2-curb --platform=ruby -- --with-curl-dir=%LIBCURL%
    you got mutch errors, cuz evil do not sleep, but dont worry, Jihad is here.

  4. Now be extrimelly carefull
    goto %RUBY%\lib\ruby\gems\1.9.1\gems\taf2-curb-0.5.4.0\ext
    evil sits in 2 files: curb_easy.h and curb_easy.c
    open them in you favorite editor with find and replace capability.
    find each entry of evil: interface, except of literall "interface..." and CAREFULLY replace it to
    interface_wtf_ms_i_love_bgates
    open Makefile, add there -llibcurl_imp to string

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

now i think you are ready, run devkitvars.bat in ext, then run make.
You have to get curb_core.so in ext dir of gem.

after this need manually change 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

gem list now will show you taf2-curb installed

here is proof of all this stuff:
constaNT im_mtf_spamma_yes_i_am you can find it's value in github feedtosis page
C:\test3>rails console
Loading development environment (Rails 3.0.3)
irb(main):001:0> client = Feedtosis::Client.new('im_mtf_spamma_yes_i_am')
=> #{}, :namespace=>"feedtosi
s", :retained_digest_size=>10}, @backend={}>
irb(main):002:0> result = client.fetch
=> #
irb(main):004:0> result.perform
=> true
irb(main):005:0> result.body_str
=> "\r\n s2full.xsl\"?>.....

0
votes

you'll want to check your mkmf.log Perhaps add curb-config to your path? -r