Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gem install typhoeus - failed to build gem extension

I'm receiving an error while trying to install a gem called typhoeus (this is used in following the book "Service Oriented Design with Rails") - I've tried a lot of things to try to get this fixed but I've hit a brick wall and am posting here in the hope someone can help.

Here is the output:

$ gem install typhoeus

Building native extensions.  This could take a while...
ERROR:  Error installing typhoeus:
    ERROR: Failed to build gem native extension.

/Users/my.name/.rvm/rubies/ruby-1.8.7-p302/bin/ruby extconf.rb
checking for curl/curl.h in /opt/local/include,/opt/local/include/curl,/Users/my.name/.rvm/rubies/ruby-1.8.7-p302/include/curl,/Users/my.name/.rvm/rubies/ruby-1.8.7-p302/include,/usr/include/curl,/usr/local/include/curl... yes
checking for curl_easy_init() in -lcurl... yes
creating Makefile

make
gcc -I. -I. -I/Users/my.name/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/1.8/i686-darwin10.5.0 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE   -fno-common -g -O2  -fno-common -pipe -fno-common   -g -DXP_UNIX -O3 -Wall -Wcast-qual -Wwrite-strings -Wconversion -Wmissing-noreturn -Winline  -c native.c
In file included from /usr/local/include/curl/curl.h:35,
                 from ./native.h:5,
                 from native.c:1:
/usr/local/include/curl/curlrules.h:143: error: size of array ‘__curl_rule_01__’ is negative
make: *** [native.o] Error 1

I'm using rvm with ruby-1.8.7-p302 on OS X Snow Leopard with the latest XCode Tools.

From searching around I've tried to do various things, such as try installing the gem under the other ruby versions I have (ree-1.8.7-2010.02, ruby-1.9.2-head, and system ruby), to passing in architecture flags (x86_64 or i386) for the ARCHFLAGS argument, etc.

I'm new to ruby so any help would be greatly appreciated, thanks!

like image 475
Folken Avatar asked Nov 28 '22 06:11

Folken


1 Answers

Not sure if this is the same on Mac but I was having the same problem with Ubuntu.

sudo apt-get install curl  

sudo apt-get install libcurl3 libcurl3-dev

sudo gem install typhoeus 

worked for me but only after installing the libcurl libraries

Thanks.

like image 131
Enric Ribas Avatar answered Dec 05 '22 21:12

Enric Ribas