Gem install typhoeus - failed to build gem extension

I get an error when trying to install a gem called typhoeus (this is used in the next book, Service Oriented Design with Rails). I tried a lot of things to try and fix this, but I "I hit a brick wall and am going here in the hope that someone can help."

Here is the result:

$ 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 am using rvm with ruby-1.8.7-p302 on OS X Snow Leopard with the latest Xcode tools.

From the search around, I tried to do different things, for example, try to install the gem under the other ruby ​​versions that I have (ree-1.8.7-2010.02, ruby-1.9.2-head and system ruby), for transmission in the banners of architecture (x86_64 or i386) for the argument ARCHFLAGS, etc.

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

+4
source share
4 answers

Not sure, but it seems like your system is not what the gem source expects.

Since it uses curl and from this old problem , I would suggest that your curl needs to be updated.

Is the system freezing installed or are you using macports - maybe you should do an update ...

Alternatively, you can try installing the latest * nix system, which may work, and thus confirm its problem in the environment.

There are a few notes on the github page on how to use it with an old twist ...

Good luck Chris

+2
source

Not sure if this is the same on a Mac, but I had 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 libcurl libraries

Thanks.

+19
source

You really need libcurl3-dev:

 sudo apt-get install libcurl3-dev sudo gem install typhoeus 

It should work fine.

+9
source

its libcurl problem, since typhoeus needs to compile the header and stuff. and the problem arises.

libcurl-dev OR installed libcurl3-dev?

+2
source

Source: https://habr.com/ru/post/1335952/


All Articles