Installing Curb Was: Re: ruby libcurl maintainer?

On 6/7/07, Md.elme focruzzaman Shuvo [email protected] wrote:

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

1 thing more, I am using windows xp insteed of linus and using ruby
1.8.5-2.1.

You need to have installed MSVC 6.0 to install this (and maybe something
more).

If you want to do scraping (as your message at bugtracker implies) try
scrubyt/mechanize/hpricot - they are easier to install and should do
the job (they differ in abstraction level, in fact scrubyt uses
mechanize that in turn uses hpricot)

Jano

Jano S. wrote:

On 6/7/07, Md.elme focruzzaman Shuvo [email protected] wrote:

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

1 thing more, I am using windows xp insteed of linus and using ruby
1.8.5-2.1.

You need to have installed MSVC 6.0 to install this (and maybe something
more).

If you want to do scraping (as your message at bugtracker implies) try
scrubyt/mechanize/hpricot - they are easier to install and should do
the job (they differ in abstraction level, in fact scrubyt uses
mechanize that in turn uses hpricot)

Jano

Thank you Jano,

Can you please explain me the entire process of installing curb & why I
need to nstall MSVC6.0.

Regards,
Shuvo.

On 6/8/07, Md.elme focruzzaman Shuvo [email protected] wrote:

Can you please explain me the entire process of installing curb & why I
need to nstall MSVC6.0.

I don’t know the precise installation process – I haven’t installed
it and I don’t want to, and I don’t have time to. :wink:

However (these are more or less generic c extension requirements):

  1. you need msvc 6.0 because curb contains c extension - to compile it
    you need a c compiler, and that must be the same as ruby was compiled
    with, therefore msvc 6. Unfortunately, it’s hard to obtain it if you
    don’t have it already. You can also try mingw, it should be
    compatible.

  2. you need libcurl installed before you can compile curb (that is
    what does the work in the background)
    (http://my.guardpuppy.com/libcurl-7.15.1-msvc-win32-ssl-0.9.8a-zlib-1.2.3.zip)

  3. then, find vsvars32.bat (in the program files/ms vs/something,
    start cmd.exe, exexute vsvars32.bat and after that you are ready to
    issue gem install curb.

  4. I know this because the errors you posted complained about missing
    tools and looking at the package.

So as I said, if you are not familiar with C development, it’s better
for you to either use unix, or choose another package
(scrubit/mechanize/etc). If you are at least a bit familiar, give it a
try…

On 6/8/07, Md.elme focruzzaman Shuvo [email protected] wrote:

  1. you need msvc 6.0 because curb contains c extension - to compile it
    start cmd.exe, exexute vsvars32.bat and after that you are ready to

Thank You again Jano,

One thins again. I already use php curl & libcurlNET. I am familier with
C/C++ also.But never use libcurl in c/c++. So, do not know how can I
install it. I try to put libcurl.dll on the System32 dir but the result
is same.I do not want to built it again just want to use the
libcurl.dll. Can you please help me? How can I install libcurl on my
machine?

I suppose you have VC6 installed.

from the zip file I mentioned, you need: 1. header files, put them in
c:/program files/msvs/vc/inc/curl
2. libcurl.dll - put it somewhere on the path
3. libcurl_imp.lib - put it into msvs/vc.lib
maybe you’ll need to rename it to curl.lib to match the gem config

After that, try again from the vsvars environment (I suppose you
should get another kind of message when you call gem from vc
environment.

J.

Jano S. wrote:

On 6/8/07, Md.elme focruzzaman Shuvo [email protected] wrote:

Can you please explain me the entire process of installing curb & why I
need to nstall MSVC6.0.

I don’t know the precise installation process – I haven’t installed
it and I don’t want to, and I don’t have time to. :wink:

However (these are more or less generic c extension requirements):

  1. you need msvc 6.0 because curb contains c extension - to compile it
    you need a c compiler, and that must be the same as ruby was compiled
    with, therefore msvc 6. Unfortunately, it’s hard to obtain it if you
    don’t have it already. You can also try mingw, it should be
    compatible.

  2. you need libcurl installed before you can compile curb (that is
    what does the work in the background)
    (http://my.guardpuppy.com/libcurl-7.15.1-msvc-win32-ssl-0.9.8a-zlib-1.2.3.zip)

  3. then, find vsvars32.bat (in the program files/ms vs/something,
    start cmd.exe, exexute vsvars32.bat and after that you are ready to
    issue gem install curb.

  4. I know this because the errors you posted complained about missing
    tools and looking at the package.

So as I said, if you are not familiar with C development, it’s better
for you to either use unix, or choose another package
(scrubit/mechanize/etc). If you are at least a bit familiar, give it a
try…

Thank You again Jano,

One thins again. I already use php curl & libcurlNET. I am familier with
C/C++ also.But never use libcurl in c/c++. So, do not know how can I
install it. I try to put libcurl.dll on the System32 dir but the result
is same.I do not want to built it again just want to use the
libcurl.dll. Can you please help me? How can I install libcurl on my
machine?

Regards,
Shuvo

Jano S. wrote:

On 6/8/07, Md.elme focruzzaman Shuvo [email protected] wrote:

  1. you need msvc 6.0 because curb contains c extension - to compile it
    start cmd.exe, exexute vsvars32.bat and after that you are ready to

Thank You again Jano,

One thins again. I already use php curl & libcurlNET. I am familier with
C/C++ also.But never use libcurl in c/c++. So, do not know how can I
install it. I try to put libcurl.dll on the System32 dir but the result
is same.I do not want to built it again just want to use the
libcurl.dll. Can you please help me? How can I install libcurl on my
machine?

I suppose you have VC6 installed.

from the zip file I mentioned, you need: 1. header files, put them in
c:/program files/msvs/vc/inc/curl
2. libcurl.dll - put it somewhere on the path
3. libcurl_imp.lib - put it into msvs/vc.lib
maybe you’ll need to rename it to curl.lib to match the gem config

After that, try again from the vsvars environment (I suppose you
should get another kind of message when you call gem from vc
environment.

J.

Thanks Jano,

You are greate.But now I got the following error message:

C:\Program Files\Microsoft Visual Studio\VC98\Bin>gem install curb
Bulk updating Gem source index for: http://gems.rubyforge.org
Building native extensions. This could take a while…
ERROR: While executing gem … (Gem::Installer::ExtensionBuildError)
ERROR: Failed to build gem native extension.

ruby extconf.rb install curb
checking for main() in curl.lib… yes
checking for curl/curl.h… yes
creating Makefile

nmake

Microsoft (R) Program Maintenance Utility Version 6.00.8168.0
Copyright (C) Microsoft Corp 1988-1998. All rights reserved.

    c:\ruby\bin\ruby -e "puts 'EXPORTS', 'Init_curb_core'"  > 

curb_core-i386
-mswin32.def
cl -nologo -I. -I. -Ic:/ruby/lib/ruby/1.8/i386-mswin32 -I. -MD
-Zi -O2b2
xg- -G6 -DHAVE_CURL_CURL_H -c -Tccurb.c
curb.c
curb_easy.h(31) : error C2236: unexpected ‘struct’ ‘$S1’
curb_easy.h(31) : error C2027: use of undefined type ‘$S1’
curb_easy.h(31) : see declaration of ‘$S1’
curb.c(224) : error C2275: ‘curl_version_info_data’ : illegal use of
this type a
s an expression
C:\PROGRA~1\MIAF9D~1\VC98\INCLUDE\curl/curl.h(1394) : see
declaration of
‘curl_version_info_data’
curb.c(224) : error C2065: ‘ver’ : undeclared identifier
curb.c(225) : error C2275: ‘VALUE’ : illegal use of this type as an
expression
c:/ruby/lib/ruby/1.8/i386-mswin32\ruby.h(86) : see declaration
of 'VALUE

curb.c(225) : error C2146: syntax error : missing ‘;’ before identifier
'curlver

curb.c(225) : error C2065: ‘curlver’ : undeclared identifier
curb.c(225) : error C2065: ‘curllongver’ : undeclared identifier
curb.c(225) : error C2065: ‘curlvernum’ : undeclared identifier
curb.c(229) : error C2223: left of ‘->version’ must point to
struct/union
curb.c(229) : error C2198: ‘rb_str_new2’ : too few actual parameters
NMAKE : fatal error U1077: ‘cl’ : return code ‘0x2’
Stop.

Gem files will remain installed in
c:/ruby/lib/ruby/gems/1.8/gems/curb-0.1.2 for
inspection.
Results logged to
c:/ruby/lib/ruby/gems/1.8/gems/curb-0.1.2/ext/gem_make.out

I put the curl(the header fielse) on to C:\Program Files\Microsoft
Visual Studio\VC98\Include path. Rename libcur_imp.lib to curl.lib and
put it into C:\Program Files\Microsoft Visual Studio\VC98\Lib path. And
finally the libcurl.dll. I do not understand well where it I can put.
So, 1st I put it the path C:\Program Files\Microsoft Visual
Studio\VC98.After got the error message 1st time I put them
(libcurl.dll,libeay32.dll,ssleay32.dll & zlib1.dll) into the path
C:\Program Files\Microsoft Visual Studio\VC98\Include.I got the same
error message.And finally I put then into C:\Program Files\Microsoft
Visual Studio\VC98\Include\curl path and I got the same error
message.What is my misstake? I guss I have failed to put the libcurl.dll
into the right path. Please help me.

Regards,
Shuvo.

Jano S. wrote:

xg- -G6 -DHAVE_CURL_CURL_H -c -Tccurb.c
curb.c

These are compiler errors:

curb_easy.h(31) : error C2236: unexpected ‘struct’ ‘$S1’
curb_easy.h(31) : error C2027: use of undefined type ‘$S1’
curb_easy.h(31) : see declaration of ‘$S1’

These are probably consequences of the above error.

of 'VALUE
NMAKE : fatal error U1077: ‘cl’ : return code ‘0x2’
Stop.

Gem files will remain installed in
c:/ruby/lib/ruby/gems/1.8/gems/curb-0.1.2 for
inspection.
Results logged to
c:/ruby/lib/ruby/gems/1.8/gems/curb-0.1.2/ext/gem_make.out

message.What is my misstake? I guss I have failed to put the libcurl.dll
into the right path. Please help me.

Ok, you’re doing good, you’re on the right path. Now your compile
environment is right, you can compile.

The error you are facing is a problem somewhere in the sources, or in
the configuration. There’s a bug filed that asks for support for
windows, so maybe it just doesn’t work. I have looked at the sources,
and can’t find that $S1, so I’m confused. I’ll have a look tomorrow,
and maybe find something (I don’t have a win box here).

In the meantime, you can try to remove the directory
(c:/ruby/lib/ruby/gems/1.8/gems/curb-0.1.2/), and try again.

J.

Hello Jano,

Thank you for contineously helping me. I try it what you say but I got
the same error.Thanks.

Regards,
Shuvo

I’m having this problem, was there ever a resolution to this?

xg- -G6 -DHAVE_CURL_CURL_H -c -Tccurb.c
curb.c

These are compiler errors:

curb_easy.h(31) : error C2236: unexpected ‘struct’ ‘$S1’
curb_easy.h(31) : error C2027: use of undefined type ‘$S1’
curb_easy.h(31) : see declaration of ‘$S1’

These are probably consequences of the above error.

of 'VALUE
NMAKE : fatal error U1077: ‘cl’ : return code ‘0x2’
Stop.

Gem files will remain installed in
c:/ruby/lib/ruby/gems/1.8/gems/curb-0.1.2 for
inspection.
Results logged to
c:/ruby/lib/ruby/gems/1.8/gems/curb-0.1.2/ext/gem_make.out

message.What is my misstake? I guss I have failed to put the libcurl.dll
into the right path. Please help me.

Ok, you’re doing good, you’re on the right path. Now your compile
environment is right, you can compile.

The error you are facing is a problem somewhere in the sources, or in
the configuration. There’s a bug filed that asks for support for
windows, so maybe it just doesn’t work. I have looked at the sources,
and can’t find that $S1, so I’m confused. I’ll have a look tomorrow,
and maybe find something (I don’t have a win box here).

In the meantime, you can try to remove the directory
(c:/ruby/lib/ruby/gems/1.8/gems/curb-0.1.2/), and try again.

J.

Ricky Winowiecki wrote:

I’m having this problem, was there ever a resolution to this?

I think curb is not built for windows. Once upon a time i was trying to
install that on my windows pc but that did not make any sense. So, I
leave it and go back to the net/http lib . it is a built in library of
ruby. So if you can write a http request/response class using it than
your code will compilable with any latest ruby built. The major
advantage of using net/http is that you do not need to install any 3rd
party library. Another fantastic tools for doing scraping with ruby is
machanize. You can use this too.

Regards,
Shuvo.

Md.elme focruzzaman Shuvo wrote:

Ricky Winowiecki wrote:

I’m having this problem, was there ever a resolution to this?

I think curb is not built for windows. Once upon a time i was trying to
install that on my windows pc but that did not make any sense. So, I
leave it and go back to the net/http lib . it is a built in library of
ruby. So if you can write a http request/response class using it than
your code will compilable with any latest ruby built. The major
advantage of using net/http is that you do not need to install any 3rd
party library. Another fantastic tools for doing scraping with ruby is
machanize. You can use this too.

Regards,
Shuvo.

Perhaps you could help with a net/http problem. I am trying to
communicate with a server by sending the following post

POST /LabelService/EwsLabelService.asmx/GetPostageLabelXML HTTP/1.1
Host: www.envmgr.com
Content-Type: application/x-www-form-urlencoded
Content-Length: length
labelRequestXML= …

I hadn’t been able to get it to work with net/http’s post_form or post
functions. I would always end up with a timeout or the server
unexpectedly terminating my connection.

I asked for an example in ruby and they gave me the following

require “curl”
xml_request = “<LabelRequest Test="YES" LabelType="Default"
LabelSize="4X6" ImageFormat="GIF">”
URL =
https://www.envmgr.com/LabelService/EwsLabelService.asmx/GetPostageLabelXML
c = Curl::Easy.http_post(URL, Curl::PostField.content(‘labelRequestXML’,
xml_request))
c.follow_location = true
c.ssl_verify_host = false
puts c.body_str

Any ideas how I could accomplish this in net/http?