Curl library?

Two questions:

1. How do I install the curl library for Ruby? I thought there was one...???
2. How come when I go 'gem search curl' I get:

root@rockhopper:~# gem search curl

*** LOCAL GEMS ***

root@rockhopper:~#

???

···

--
"It's the preponderance, stupid!" - Professor Stephen Schneider, IPCC member

I just got the following responses trying to install curb and curl-multi:

# gem install curl-multi
Building native extensions. This could take a while...
ERROR: Error installing curl-multi:
  ERROR: Failed to build gem native extension.

/usr/bin/ruby1.8 extconf.rb
extconf.rb:1:in `require': no such file to load -- mkmf (LoadError)
  from extconf.rb:1

Gem files will remain installed in /var/lib/gems/1.8/gems/curb-0.7.1 for inspection.
Results logged to /var/lib/gems/1.8/gems/curb-0.7.1/ext/gem_make.out
root@rhaptools:~# gem install curb
Building native extensions. This could take a while...
ERROR: Error installing curb:
  ERROR: Failed to build gem native extension.

/usr/bin/ruby1.8 extconf.rb
extconf.rb:1:in `require': no such file to load -- mkmf (LoadError)
  from extconf.rb:1

Gem files will remain installed in /var/lib/gems/1.8/gems/curb-0.7.1 for inspection.
Results logged to /var/lib/gems/1.8/gems/curb-0.7.1/ext/gem_make.out

···

On 10-05-18 02:35 PM, Xeno Campanoli / Eskimo North and Gmail wrote:

Two questions:

1. How do I install the curl library for Ruby? I thought there was
one...???
2. How come when I go 'gem search curl' I get:

root@rockhopper:~# gem search curl

*** LOCAL GEMS ***

root@rockhopper:~#

???

--
"It's the preponderance, stupid!" - Professor Stephen Schneider, IPCC member

You should try to search the forum first for the answer:
`require - Google Search’%3A+no+such+file+to+load±-+mkmf+(LoadError)+site%3Aruby-forum.com
Anyway, you need the ruby development packages. In ubuntu / debian its
named ruby1.8-dev (or ruby1.9-dev)

Bye

···

On Tue, May 18, 2010 at 6:56 PM, Xeno Campanoli / Eskimo North and Gmail <xeno.campanoli@gmail.com> wrote:

On 10-05-18 02:35 PM, Xeno Campanoli / Eskimo North and Gmail wrote:

Two questions:

1. How do I install the curl library for Ruby? I thought there was
one...???
2. How come when I go 'gem search curl' I get:

root@rockhopper:~# gem search curl

*** LOCAL GEMS ***

root@rockhopper:~#

???

I just got the following responses trying to install curb and curl-multi:

# gem install curl-multi
Building native extensions. This could take a while...
ERROR: Error installing curl-multi:
ERROR: Failed to build gem native extension.

/usr/bin/ruby1.8 extconf.rb
extconf.rb:1:in `require': no such file to load -- mkmf (LoadError)
from extconf.rb:1

Gem files will remain installed in /var/lib/gems/1.8/gems/curb-0.7.1 for
inspection.
Results logged to /var/lib/gems/1.8/gems/curb-0.7.1/ext/gem_make.out
root@rhaptools:~# gem install curb
Building native extensions. This could take a while...
ERROR: Error installing curb:
ERROR: Failed to build gem native extension.

/usr/bin/ruby1.8 extconf.rb
extconf.rb:1:in `require': no such file to load -- mkmf (LoadError)
from extconf.rb:1

Gem files will remain installed in /var/lib/gems/1.8/gems/curb-0.7.1 for
inspection.
Results logged to /var/lib/gems/1.8/gems/curb-0.7.1/ext/gem_make.out

--
Luis Parravicini
http://ktulu.com.ar/blog/

Well, I got that -dev thing installed with apt-get, and then I tried again and got this log:

find_executable: checking for curl-config... -------------------- no

···

--------------------

have_library: checking for main() in -lcurl... -------------------- no

"gcc -o conftest -I. -I/usr/lib/ruby/1.8/i486-linux -I. -D_FILE_OFFSET_BITS=64 -fno-strict-aliasing -g -g -O2 -fPIC conftest.c -L. -L/usr/lib -L. -Wl,-Bsymbolic-functions -rdynamic -Wl,-export-dynamic -lruby1.8-static -lcurl -lpthread -lrt -ldl -lcrypt -lm -lc"
/usr/bin/ld: cannot find -lcurl
collect2: ld returned 1 exit status
checked program was:
/* begin */
1: /*top*/
2: int main() { return 0; }
3: int t() { void ((*volatile p)()); p = (void ((*)()))main; return 0; }
/* end */

"gcc -o conftest -I. -I/usr/lib/ruby/1.8/i486-linux -I. -D_FILE_OFFSET_BITS=64 -fno-strict-aliasing -g -g -O2 -fPIC conftest.c -L. -L/usr/lib -L. -Wl,-Bsymbolic-functions -rdynamic -Wl,-export-dynamic -lruby1.8-static -lcurl -lpthread -lrt -ldl -lcrypt -lm -lc"
/usr/bin/ld: cannot find -lcurl
collect2: ld returned 1 exit status
checked program was:
/* begin */
1: /*top*/
2: int main() { return 0; }
3: int t() { main(); return 0; }
/* end */

--------------------

and then this one:

/usr/bin/ruby1.8 extconf.rb
"-fno-strict-aliasing -g -g -O2 -fPIC $(cflags)"
checking for curl-config... no
checking for main() in -lcurl... 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
         --without-make-prog
         --srcdir=.
         --curdir
         --ruby=/usr/bin/ruby1.8
         --with-curl-dir
         --without-curl-dir
         --with-curl-include
         --without-curl-include=${curl-dir}/include
         --with-curl-lib
         --without-curl-lib=${curl-dir}/lib
         --with-curllib
         --without-curllib
extconf.rb:19: 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.

On 10-05-18 03:05 PM, Luis Parravicini wrote:

On Tue, May 18, 2010 at 6:56 PM, Xeno Campanoli / Eskimo North and > Gmail<xeno.campanoli@gmail.com> wrote:

On 10-05-18 02:35 PM, Xeno Campanoli / Eskimo North and Gmail wrote:

Two questions:

1. How do I install the curl library for Ruby? I thought there was
one...???
2. How come when I go 'gem search curl' I get:

root@rockhopper:~# gem search curl

*** LOCAL GEMS ***

root@rockhopper:~#

???

I just got the following responses trying to install curb and curl-multi:

# gem install curl-multi
Building native extensions. This could take a while...
ERROR: Error installing curl-multi:
        ERROR: Failed to build gem native extension.

/usr/bin/ruby1.8 extconf.rb
extconf.rb:1:in `require': no such file to load -- mkmf (LoadError)
        from extconf.rb:1

Gem files will remain installed in /var/lib/gems/1.8/gems/curb-0.7.1 for
inspection.
Results logged to /var/lib/gems/1.8/gems/curb-0.7.1/ext/gem_make.out
root@rhaptools:~# gem install curb
Building native extensions. This could take a while...
ERROR: Error installing curb:
        ERROR: Failed to build gem native extension.

/usr/bin/ruby1.8 extconf.rb
extconf.rb:1:in `require': no such file to load -- mkmf (LoadError)
        from extconf.rb:1

Gem files will remain installed in /var/lib/gems/1.8/gems/curb-0.7.1 for
inspection.
Results logged to /var/lib/gems/1.8/gems/curb-0.7.1/ext/gem_make.out

You should try to search the forum first for the answer:
`require - Google Search’%3A+no+such+file+to+load±-+mkmf+(LoadError)+site%3Aruby-forum.com
Anyway, you need the ruby development packages. In ubuntu / debian its
named ruby1.8-dev (or ruby1.9-dev)

Bye

--
"It's the preponderance, stupid!" - Professor Stephen Schneider, IPCC member

Two questions:

1. How do I install the curl library for Ruby? I thought there was
one...???
2. How come when I go 'gem search curl' I get:

root@rockhopper:~# gem search curl

*** LOCAL GEMS ***

root@rockhopper:~#

???

gem search foo searches local gems. You want to search the remote gem repository. So you need the -r flag:

metatron:~ james$ gem search -r curl

*** REMOTE GEMS ***

ARBarlow-rubycurl (1.5.0)
arbarlow-rubycurl (1.7.3)
cjbottaro-curly_mustache (0.0.0)
curl-multi (0.2)
curly (0.0.3)
curly_mustache (0.1.0)
juozasg-curl-multi (0.2.1)
recurly (0.1.4)
rubycurl (1.7.3)
typhoeus_curly (0.1.14)
metatron:~ james$

Thank you. That appears to have gotten me going...

···

On 10-05-18 04:12 PM, James Harrison wrote:

Two questions:

1. How do I install the curl library for Ruby? I thought there was
one...???
2. How come when I go 'gem search curl' I get:

root@rockhopper:~# gem search curl

*** LOCAL GEMS ***

root@rockhopper:~#

???

gem search foo searches local gems. You want to search the remote gem repository. So you need the -r flag:

metatron:~ james$ gem search -r curl

*** REMOTE GEMS ***

ARBarlow-rubycurl (1.5.0)
arbarlow-rubycurl (1.7.3)
cjbottaro-curly_mustache (0.0.0)
curl-multi (0.2)
curly (0.0.3)
curly_mustache (0.1.0)
juozasg-curl-multi (0.2.1)
recurly (0.1.4)
rubycurl (1.7.3)
typhoeus_curly (0.1.14)
metatron:~ james$

--
"It's the preponderance, stupid!" - Professor Stephen Schneider, IPCC member

So, I installed rubycurl, that being the listed package of greatest maturity, but no document I can find can seem to help me use it. Most of the stuff on line refers to curb or multi-curb it seems.

xc

···

On 10-05-18 04:28 PM, Xeno Campanoli / Eskimo North and Gmail wrote:

On 10-05-18 04:12 PM, James Harrison wrote:

Thank you. That appears to have gotten me going...

Two questions:

1. How do I install the curl library for Ruby? I thought there was
one...???
2. How come when I go 'gem search curl' I get:

root@rockhopper:~# gem search curl

*** LOCAL GEMS ***

root@rockhopper:~#

???

gem search foo searches local gems. You want to search the remote gem
repository. So you need the -r flag:

metatron:~ james$ gem search -r curl

*** REMOTE GEMS ***

ARBarlow-rubycurl (1.5.0)
arbarlow-rubycurl (1.7.3)
cjbottaro-curly_mustache (0.0.0)
curl-multi (0.2)
curly (0.0.3)
curly_mustache (0.1.0)
juozasg-curl-multi (0.2.1)
recurly (0.1.4)
rubycurl (1.7.3)
typhoeus_curly (0.1.14)
metatron:~ james$

--
"It's the preponderance, stupid!" - Professor Stephen Schneider, IPCC member

You could also use net/http which is part of the standar library and documented:

http://www.ruby-doc.org/stdlib/libdoc/net/http/rdoc/index.html

Kind regards

robert

···

2010/5/19 Xeno Campanoli / Eskimo North and Gmail <xeno.campanoli@gmail.com>:

On 10-05-18 04:28 PM, Xeno Campanoli / Eskimo North and Gmail wrote:

So, I installed rubycurl, that being the listed package of greatest
maturity, but no document I can find can seem to help me use it. Most of
the stuff on line refers to curb or multi-curb it seems.

--
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/

Yes, but I am trying to move from using curl on shell to getting the same functionality without the two extra forks to shell and to curl itself. Plus the native has a bad wrap, I don't know if it's deserved, but I haven't found it copasetic myself.

···

On 10-05-20 02:37 AM, Robert Klemme wrote:

2010/5/19 Xeno Campanoli / Eskimo North and Gmail<xeno.campanoli@gmail.com>:

On 10-05-18 04:28 PM, Xeno Campanoli / Eskimo North and Gmail wrote:

So, I installed rubycurl, that being the listed package of greatest
maturity, but no document I can find can seem to help me use it. Most of
the stuff on line refers to curb or multi-curb it seems.

You could also use net/http which is part of the standar library and documented:

http://www.ruby-doc.org/stdlib/libdoc/net/http/rdoc/index.html

Kind regards

robert

--
"It's the preponderance, stupid!" - Professor Stephen Schneider, IPCC member

Why two forks? In order to start curl as an external process you just
need one fork and one exec (or use "system"). Also, why do you say
"but"? Net/HTTP does not need "curl" or any other external process so
I do not see how my suggestion contradicts your goal. On the
contrary, I deliberately suggested to use Net/HTTP in order to _not_
have to depend on gems or external processes.

Cheers

robert

···

2010/5/20 Xeno Campanoli / Eskimo North and Gmail <xeno.campanoli@gmail.com>:

On 10-05-20 02:37 AM, Robert Klemme wrote:

2010/5/19 Xeno Campanoli / Eskimo North and
Gmail<xeno.campanoli@gmail.com>:

On 10-05-18 04:28 PM, Xeno Campanoli / Eskimo North and Gmail wrote:

So, I installed rubycurl, that being the listed package of greatest
maturity, but no document I can find can seem to help me use it. Most of
the stuff on line refers to curb or multi-curb it seems.

You could also use net/http which is part of the standar library and
documented:

http://www.ruby-doc.org/stdlib/libdoc/net/http/rdoc/index.html

Yes, but I am trying to move from using curl on shell to getting the same
functionality without the two extra forks to shell and to curl itself. Plus
the native has a bad wrap, I don't know if it's deserved, but I haven't
found it copasetic myself.

--
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/

Among other things we have built the tool around curl facilities like the --trace-time function, and we don't want to mix in new stuff, or add variations in the kind of data we get. Also, all the switches for handling post data, HTTP headers, cookies, etc are working well, and it's not clear you can do all of those things, let alone in a reasonably good way, with the net/http. I am certainly interested in your opinion on that.

Curl registers timestamps for points before the socket connection, as well as for receipt of each of the important HTTP headers, and then after the HTTP protocol activities are over the closure steps. Can I get that from net/http?

···

On 10-05-20 08:01 AM, Robert Klemme wrote:

2010/5/20 Xeno Campanoli / Eskimo North and Gmail<xeno.campanoli@gmail.com>:

On 10-05-20 02:37 AM, Robert Klemme wrote:

2010/5/19 Xeno Campanoli / Eskimo North and
Gmail<xeno.campanoli@gmail.com>:

On 10-05-18 04:28 PM, Xeno Campanoli / Eskimo North and Gmail wrote:

So, I installed rubycurl, that being the listed package of greatest
maturity, but no document I can find can seem to help me use it. Most of
the stuff on line refers to curb or multi-curb it seems.

You could also use net/http which is part of the standar library and
documented:

http://www.ruby-doc.org/stdlib/libdoc/net/http/rdoc/index.html

Yes, but I am trying to move from using curl on shell to getting the same
functionality without the two extra forks to shell and to curl itself. Plus
the native has a bad wrap, I don't know if it's deserved, but I haven't
found it copasetic myself.

Why two forks? In order to start curl as an external process you just
need one fork and one exec (or use "system"). Also, why do you say
"but"? Net/HTTP does not need "curl" or any other external process so
I do not see how my suggestion contradicts your goal. On the
contrary, I deliberately suggested to use Net/HTTP in order to _not_
have to depend on gems or external processes.

Cheers

robert

--
"It's the preponderance, stupid!" - Professor Stephen Schneider, IPCC member

Yes. Here's some pseudocode:

h = Net::HTTP.new
h.start do
  p :connected!

  h.request do |r|
    p :headers!
    r.read_body
    p :body!
  end
end

···

On May 20, 2010, at 10:45, Xeno Campanoli / Eskimo North and Gmail wrote:

Among other things we have built the tool around curl facilities like the --trace-time function, and we don't want to mix in new stuff, or add variations in the kind of data we get. Also, all the switches for handling post data, HTTP headers, cookies, etc are working well, and it's not clear you can do all of those things, let alone in a reasonably good way, with the net/http. I am certainly interested in your opinion on that.

Curl registers timestamps for points before the socket connection, as well as for receipt of each of the important HTTP headers, and then after the HTTP protocol activities are over the closure steps. Can I get that from net/http?

Among other things we have built the tool around curl facilities like the --trace-time function, and we don't want to mix in new stuff, or add variations in the kind of data we get. Also, all the switches for handling post data, HTTP headers, cookies, etc are working well, and it's not clear you can do all of those things, let alone in a reasonably good way, with the net/http. I am certainly interested in your opinion on that.

Curl registers timestamps for points before the socket connection, as well as for receipt of each of the important HTTP headers, and then after the HTTP protocol activities are over the closure steps. Can I get that from net/http?

Yes. Here's some pseudocode:

I'm sorry. That is not pertinent to what I said. Perhaps you should learn curl.

···

On 10-05-20 07:30 PM, Eric Hodel wrote:

On May 20, 2010, at 10:45, Xeno Campanoli / Eskimo North and Gmail wrote:

h = Net::HTTP.new
h.start do
   p :connected!

   h.request do |r|
     p :headers!
     r.read_body
     p :body!
   end
end

--
"It's the preponderance, stupid!" - Professor Stephen Schneider, IPCC member

Curl registers timestamps for points before the socket connection, as well as for receipt of each of the important HTTP headers, and then after the HTTP protocol activities are over the closure steps. Can I get that from net/http?

Yes. Here's some pseudocode:

I'm sorry. That is not pertinent to what I said. Perhaps you should learn curl.

You asked how to get timestamps using net/http for various things that curl gives timestamps for. The pseudocode I answered with below shows you exactly where to hook net/http to get those timestamps. I didn't think learning curl was required in order to get timestamps for various stages of an HTTP request using net/http. Perhaps you should be more specific in your requirements.

h = Net::HTTP.new
h.start do
  p :connected!

  h.request do |r|
    p :headers!
    r.read_body
    p :body!
  end
end

PS: The Net::HTTP documentation explains how to do the following other things you asked if net/http can do in ruby-talk:363103, "handling post data, HTTP headers, cookies, etc"

···

On May 20, 2010, at 20:23, Xeno Campanoli / Eskimo North and Gmail wrote: