public
Description: Ruby bindings for libcurl
Home | Edit | New

FAQ

Why with easy.url I obtain an “old” url and not the last used?

.url gives the url that curb processed when it was initialized, to resolve, simply use the .last_effective_url method, [taf2]

How to compile curb in FreeBSD? [Tested under FreeBSD 7.1{DesktopBSD}]

Install libcurl /usr/ports/ftp/curl and ruby /usr/ports/lang/ruby18, then do ‘gem i curb’, you will receive an error message, at the end you will see:
"Gem files will remain installed in /thir/to/cd/"
then simply ‘cd /thir/to/cd/’ and “rake install EXTCONF_OPTS=‘—with-curl-dir=/usr/local/’”

Curl::Easy.new takes a long time to run.
Curl::Easy.new invokes curl_easy_init, which intern calls openssl functions – if libcurl was built using openssl. On Mac OSX, I observed 0.1 second delays when calling curl_easy_init. If you don’t use SSL and need performance on Mac, I recommend NOT building libcurl with SSL support enabled.

Snow Leopard (OSX 10.6) – build errors


sudo rake install
(in /Users/xxxx/work/github/curb)
gcc I. -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin10.0 -I. -DRUBY_EXTCONF_H=\“curb_config.h\” -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -fno-common -arch i386 -arch x86_64 -g -Os -pipe -fno-common -DENABLE_DTRACE -fno-common -pipe -fno-common -I/opt/local/include -Wall -c curb.c
In file included from /opt/local/include/curl/curl.h:36,
from curb.h:12,
from curb.c:8:
/opt/local/include/curl/curlrules.h:144: error: size of array ‘__curl_rule_01__’ is negative
/opt/local/include/curl/curlrules.h:154: error: size of array ‘__curl_rule_02__’ is negative
lipo: can’t open input file: /var/tmp//ccmASHN7.out (No such file or directory)
make: * [curb.o] Error 1
rake aborted!
Make failed (status 2)
/Users/xxxx/work/github/curb/Rakefile:60
(See full trace by running task with —trace)

Solution

sudo port install curl +universal

If the above doesn’t output something like: (notice the x86_64) (if you see ppc) something is wrong!

sudo port install curl +universal
-→ Computing dependencies for curl
—> Fetching curl
-
→ Verifying checksum(s) for curl
—> Extracting curl
-
→ Configuring curl
—> Configuring curl for architecture x86_64
-
→ Configuring curl for architecture i386
—> Building curl
-
→ Building curl for architecture x86_64
—> Building curl for architecture i386
-
→ Staging curl into destroot
—> Staging curl into destroot for architecture x86_64
-
→ Staging curl into destroot for architecture i386
—> Installing curl @7.19.6_0+universal
-
→ Deactivating curl @7.19.6_0
—> Activating curl @7.19.6_0+universal
-
→ Cleaning curl

Alt solution
sudo env ARCHFLAGS=“-arch x86_64” gem install curb

Last edited by taf2, Tue Sep 22 16:19:38 -0700 2009
Home | Edit | New
Versions: