Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8506287
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T02:33:09+00:00 2026-06-11T02:33:09+00:00

I’m installing the Ruby Nokogiri gem and finding the error below. How to diagnose

  • 0

I’m installing the Ruby Nokogiri gem and finding the error below.

How to diagnose this and solve it?

# gem install nokogiri
Building native extensions.  This could take a while...
ERROR:  Error installing nokogiri:
ERROR: Failed to build gem native extension.
...
/opt/ruby/1.9.3-p194/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 may need configuration options.
...
/opt/ruby/1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:381:in `try_do': 
The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from /opt/ruby/1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:506:in `try_cpp'
...
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T02:33:11+00:00Added an answer on June 11, 2026 at 2:33 am

    To diagnose and solve, here’s what worked for me.

    To find out what failed, go to your ruby gems directory.

    For example:

    $ cd <MY RUBY DIRECTORY>/lib/ruby/gems/2.0.0/gems
    

    If you don’t know your gem directory, try this:

    $ echo $GEM_HOME
    /opt/gems/2.0.0
    $ cd /opt/gems/2.0.0/gems
    

    What version of nokogiri am I installing?

    $ ls -ladg nokogiri-*
    nokogiri-1.5.5
    

    Go to the installer directory:

    $ cd nokogiri-1.5.5/ext/nokogiri
    

    Try installing manually:

    $ ruby extconf.rb
    

    Result:

    checking for libxml/parser.h... *** extconf.rb failed ***
    ...
    

    I’m using Ubuntu so I search for any similar packages:

    $ aptitude search libxml
    

    Results:

    p libxml2 - GNOME XML library
    p libxml2-dev - Development files for the GNOME XML library
    ...
    

    I believe that libxml2 will work fine.

    $ apt-get install libxml2
    

    Ruby native gems often need the *-dev packages for headers so install them:

    $ apt-get install libxml2-dev
    

    Now do I have the parser file?

    $ find / | grep libxml/parser.h
    

    Yes, the result shows the parser:

    /usr/include/libxml2/libxml/parser.h
    

    Now try installing again, this time providing the libxml2 path:

    $ gem install nokogiri -- --with-xml2-dir=/usr/include/libxml2
    

    It still fails, so read the mkmf error log:

    $ more mkmf.log 
    

    The error log shows what failed and has these lines that look promising:

    package configuration for libxslt is not found
    

    Is there a package for it?

    $ aptitude search libxslt
    

    Results:

    v   libxslt-dev
    i   libxslt-ruby
    ...
    

    Install the dev package:

    $ apt-get install libxslt-dev
    

    Now try installing again, and also put xslt on the path:

    $ gem install nokogiri -- \
    --with-xml2-dir=/usr/include/libxml2 \
    --with-xslt-dir=/usr/include/libxslt
    

    Success!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
Does anyone know how can I replace this 2 symbol below from the string
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
For some reason, after submitting a string like this Jack’s Spindle from a text
this is what i have right now Drawing an RSS feed into the php,
I have this code to decode numeric html entities to the UTF8 equivalent character.
We're building an app, our first using Rails 3, and we're having to build
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.