You are not logged in.

#1 2011-03-10 02:28:21

b-rod
Member
Registered: 2011-03-09
Posts: 8

Ruby on Rails install problem

I'm at the point in my RoR install where I'm executing a "bundle install" command.  The install fails when it trys to install nokogiri 1.4.4.  The error message reads "failed to build gem native extension".  Any ideas as to why this gem is failing to install?

Offline

#2 2011-03-10 04:06:44

cactus
Taco Eater
From: t͈̫̹ͨa͖͕͎̱͈ͨ͆ć̥̖̝o̫̫̼s͈̭̱̞͍̃!̰
Registered: 2004-05-25
Posts: 4,622
Website

Re: Ruby on Rails install problem

What version of ruby are you using?
ruby -v


"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍

Offline

#3 2011-03-10 04:09:35

cactus
Taco Eater
From: t͈̫̹ͨa͖͕͎̱͈ͨ͆ć̥̖̝o̫̫̼s͈̭̱̞͍̃!̰
Registered: 2004-05-25
Posts: 4,622
Website

Re: Ruby on Rails install problem


"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍

Offline

#4 2011-03-10 13:41:46

b-rod
Member
Registered: 2011-03-09
Posts: 8

Re: Ruby on Rails install problem

I'm running ruby v1.9.2p180. 

Here is the main area of the section of error message I receive after a bundle install command...

Using activerecord (3.0.5)
Using bundler (1.0.10)
Using diff-lcs (1.1.2)
Installing nokogiri (1.4.4) with native extensions /usr/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:533:in 'rescue in block in build_extensions': ERROR: failed to build gem native extension.  (Gem::Installer::ExtensionBuildError)

/usr/bin/ruby extconf.rb
checking for libxml/parser.h...***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 many need configuration options.

Provided configuration options:
     --with-opt-dir
     --without-opt-dir

Offline

#5 2011-03-10 14:14:34

awkwood
Member
From: .au <=> .ca
Registered: 2009-04-23
Posts: 91

Re: Ruby on Rails install problem

Nokogiri requires libxml2 and libxslt in order to compile.  Do you have both installed?

  sudo pacman -S libxml2 libxslt

More info here

Offline

#6 2011-03-10 14:59:54

b-rod
Member
Registered: 2011-03-09
Posts: 8

Re: Ruby on Rails install problem

Yes I do have both libs installed...
libxml2 v2.7.8-1
libxslt v1.1.26-2

Offline

#7 2011-03-10 23:44:15

cactus
Taco Eater
From: t͈̫̹ͨa͖͕͎̱͈ͨ͆ć̥̖̝o̫̫̼s͈̭̱̞͍̃!̰
Registered: 2004-05-25
Posts: 4,622
Website

Re: Ruby on Rails install problem

try

gem install --verbose --no-rdoc --no-ri nokogiri

see if you get any more informative error messages


"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍

Offline

#8 2011-03-11 00:53:13

b-rod
Member
Registered: 2011-03-09
Posts: 8

Re: Ruby on Rails install problem

gave me the same error messages as before (listed in previous reply).  I think the problem might be that libxml2 and libxslt are not located in a place where nokogiri is looking when being installed therefore I'm getting the error messages.  And I'm not sure what config options to pass when doing a "gem install nokogiri".

Offline

#9 2011-03-11 02:35:30

awkwood
Member
From: .au <=> .ca
Registered: 2009-04-23
Posts: 91

Re: Ruby on Rails install problem

The page I linked to has a section near the bottom called "Nonstandard libxml2 / libxslt installations" which shows the config options to use.

Have you checked mkmf.log? It may contain a more specific error message.

Offline

#10 2011-03-11 18:56:57

b-rod
Member
Registered: 2011-03-09
Posts: 8

Re: Ruby on Rails install problem

I used the config options listed in your previous link with the same error message results.  My mkmf.log does not contain any error messages.  I really don't know what to do next...I'll just have to keep on lookin'.

Offline

#11 2014-03-17 05:26:17

paulie4
Member
Registered: 2014-03-17
Posts: 2

Re: Ruby on Rails install problem

I had the same problem. It turns out that the Ruby "mkmf" library's pkg_config method (http://rubydoc.info/stdlib/mkmf/MakeMak … nce_method) will just silently say it can't find a library if the "pkg-config" program doesn't exist. It should probably just give an error if pkg-config doesn't exist. I just had to run "pacman -S base-devel", and that fixed the "checking for libxml/parser.h..." error.

Now, my latest ~/.bundler/tmp/*/extensions/x86_64-linux/2.1.0/nokogiri-1.5.9/mkmf.log is showing the following:

"gcc -o conftest -I/usr/include/ruby-2.1.0/x86_64-linux -I/usr/include/ruby-2.1.0/ruby/backward -I/usr/include/ruby-2.1.0 -I. -I/opt/local/include/libxml2 -I/usr/local/include/libxml2 -I/opt/local/include -I/usr/local/include -I/usr/include -I/usr/include -I/usr/include/libxml2 -D_FORTIFY_SOURCE=2   -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -fPIC --with-xml2-dir=/usr/include/libxml2 --with-xslt-dir=/usr/include/libxslt -g -DXP_UNIX -Wall -Wcast-qual -Wwrite-strings -Wconversion -Wmissing-noreturn -Winline conftest.c  -L. -L/usr/lib -L/opt/local/lib -L/usr/local/lib -L/usr/lib -lxslt -lxml2 -lz -lm -ldl -lm -lxml2     -lruby  -lpthread -lgmp -ldl -lcrypt -lm   -lc "
gcc: error: unrecognized command line option ‘--with-xml2-dir=/usr/include/libxml2’
gcc: error: unrecognized command line option ‘--with-xslt-dir=/usr/include/libxslt’
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: int main(int argc, char **argv)
4: {
5:   return 0;
6: }
/* end */

Offline

#12 2014-03-17 15:07:14

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 16,686

Re: Ruby on Rails install problem

Hi paulie4,
Welcome to Arch Linux.  I cannot tell if you are having a problem, or if you are contributing additional information to the thread.  Regardless, this thread is three years old, and much has changed in that time.   I am going to go ahead and close this thread.  If you are having a problem, please feel free to start a new thread and, if you feel it is appropriate, provide a BBCode link back to this thread as a reference.   

Thanks.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

Board footer

Powered by FluxBB