tags:

views:

1460

answers:

6

I can't figure out what is going wrong here -- any ideas??

I'm running on a Ubuntu 8.04 LTS, and have installed libxml2 and libxslt from these instructions:

http://www.techsww.com/tutorials/libraries/libxml/installation/installing_libxml_on_ubuntu_linux.php

http://www.techsww.com/tutorials/libraries/libxslt/installation/installing_libxslt_on_ubuntu_linux.php

However, I installed the latest versions:

libxslt-1.1.24
libxml2-2.7.3

The install was uneventful

-------------------- I set LD_LIBRARY_PATH ----------------------------------

echo $LD_LIBRARY_PATH
/usr/local/libxslt/lib:

------------- seems like the function is present -- at least based on the output of strings ------------
/usr/local/libxslt/lib$ strings * | grep ParseStylesheetDoc
xsltParseStylesheetDoc
xsltParseStylesheetDoc
xsltParseStylesheetDoc
xsltParseStylesheetDoc
xsltParseStylesheetDoc
xsltParseStylesheetDoc
xsltParseStylesheetDoc

----------------------- But the compile still fails ----------------------------------------

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

/usr/local/bin/ruby extconf.rb install webrat
checking for iconv.h in /opt/local/include/,/opt/local/include/libxml2,/opt/local/include,/opt/local/include,/opt/local/include/libxml2,/usr/local/include,/usr/local/include/libxml2,/usr/local/include,/usr/local/include/libxml2,/usr/include,/usr/include/libxml2... yes
checking for libxml/parser.h in /opt/local/include/,/opt/local/include/libxml2,/opt/local/include,/opt/local/include,/opt/local/include/libxml2,/usr/local/include,/usr/local/include/libxml2,/usr/local/include,/usr/local/include/libxml2,/usr/include,/usr/include/libxml2... yes
checking for libxslt/xslt.h in /opt/local/include/,/opt/local/include/libxml2,/opt/local/include,/opt/local/include,/opt/local/include/libxml2,/usr/local/include,/usr/local/include/libxml2,/usr/local/include,/usr/local/include/libxml2,/usr/include,/usr/include/libxml2... yes
checking for libexslt/exslt.h in /opt/local/include/,/opt/local/include/libxml2,/opt/local/include,/opt/local/include,/opt/local/include/libxml2,/usr/local/include,/usr/local/include/libxml2,/usr/local/include,/usr/local/include/libxml2,/usr/include,/usr/include/libxml2... yes
checking for xmlParseDoc() in -lxml2... yes
checking for xsltParseStylesheetDoc() in -lxslt... no
libxslt is missing. try 'port install libxslt' or 'yum install libxslt-devel'
*** 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.

Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/usr/local/bin/ruby
--with-iconv-dir
--without-iconv-dir
--with-iconv-include
--without-iconv-include=${iconv-dir}/include
--with-iconv-lib
--without-iconv-lib=${iconv-dir}/lib
--with-xml2-dir
--without-xml2-dir
--with-xml2-include
--without-xml2-include=${xml2-dir}/include
--with-xml2-lib
--without-xml2-lib=${xml2-dir}/lib
--with-xslt-dir
--without-xslt-dir
--with-xslt-include
--without-xslt-include=${xslt-dir}/include
--with-xslt-lib
--without-xslt-lib=${xslt-dir}/lib
--with-xml2lib
--without-xml2lib
--with-xsltlib
--without-xsltlib

Gem files will remain installed in /usr/local/lib/ruby/gems/1.8/gems/nokogiri-1.3.3 for inspection.
Results logged to /usr/local/lib/ruby/gems/1.8/gems/nokogiri-1.3.3/ext/nokogiri/gem_make.out

A: 

Try removing the libxslt* and install them again. That fixed the issue for me.

kilari
I reinstalled libxslt with a default ./configure run, and it fixed it. Essentially the same solution.Thanks
marfarma
A: 

You have to install the development kits of these libraries.

Thijs Wouters
Yes, but the problem was, that although the install seemed correct, it wasn't working. The solution of rebuilding the libraries should have been useless. However, in both my case as OP, and the case of the poster who's response I tagged as the answer, it fixed the problem. Doesn't make sense, but that's what it is.
marfarma
A: 

kilari is right ... try "yum reinstall libxslt". It works for me too.

Anonymous
+2  A: 

In Ubuntu you need to follow these steps: sudo apt-get install libxml2-dev sudo apt-get install libxslt-dev

Vintik
A: 

I get the same error when trying to install to a non-standard location (as I don't have access to directories outside my home directory). It seems as if this answer simply installed to the default location in /usr for success. Or did I misunderstand?

More context about what I'm trying to do at http://groups.google.com/group/nokogiri-talk/browse_thread/thread/c1e909be09e90f5a, if that's helpful.

David Alan Hjelle
+1  A: 

Jared Evans in this post on his blog, described a solution that worked for me on Ubuntu 8.04 LTS. His trick is to NOT use apt-get to install rubygems, but rather to build it from source. This worked great for me. His post is directed at installing rails, so I used these (modified slightly) steps from it to just install nokogiri:

FIRST INSTALL RUBY WITH APT-GET:

 sudo apt-get update
 sudo apt-get install ruby irb ri rdoc ruby1.8-dev libzlib-ruby
  libyaml-ruby libreadline-ruby libncurses-ruby libcurses-ruby libruby
  libruby-extras libfcgi-ruby1.8 build-essential libopenssl-ruby
  libdbm-ruby libdbi-ruby libdbd-sqlite3-ruby sqlite3 libsqlite3-dev
  libsqlite3-ruby libxml-ruby libxml2-dev

IN ADDITION TO JARED'S INSTRUCTIONS I ALSO INSTALLED (I'm not certain that libxslt1.1 is necessary):

 sudo apt-get install libxslt1.1
 sudo apt-get install libxslt1-dev

DOWNLOAD RUBYGEMS SOURCE:

Download the latest RubyGems (currently 1.3.6) from rubyforge (I used the zip package).

BUILD RUBYGEMS:

 cd /TO/DIRECTORY/WHERE/YOU/UNZIPPED/rubygems-1.3.6/
 sudo ruby setup.rb
 sudo ln -s /usr/bin/gem1.8 /usr/bin/gem

INSTALL NOKOGIRI:

 sudo gem update –system
 sudo gem install nokogiri

The response will be:

1 gem installed
Installing ri documentation for nokogiri-1.4.1...

No definition for parse_memory

No definition for parse_file

No definition for parse_with

No definition for get_options

No definition for set_options
Installing RDoc documentation for nokogiri-1.4.1...

No definition for parse_memory

No definition for parse_file

No definition for parse_with

No definition for get_options

No definition for set_options

I haven't yet noticed any problems caused by the 'No definition' messages...

steph