Hi!
While I realize that many will say "use a different host," well, I
could. I'm just nearly done with this project and using nokogiri on an
optional feature, so my easiest solution is to just drop it. Before I
do that, however, I wanted to give the wisdom of the list a try.
Dreamhost does not have a current enough version of libxml2 installed,
nor a version of libxslt. So I went ahead and installed my own via
these commands:
mkdir libxml2
cd libxml2
wget
ftp://xmlsoft.org/libxml2/libxml2-2.7.6.tar.gz
tar -zxf libxml2-2.7.6.tar.gz
cd libxml2-2.7.6
./configure --prefix=$HOME/local/ --exec-prefix=$HOME/local
make
make install
cd ..
wget
ftp://xmlsoft.org/libxml2/libxslt-1.1.26.tar.gz
tar -zxf libxslt-1.1.26.tar.gz
cd libxslt-1.1.26
./configure --prefix=$HOME/local/ --exec-prefix=$HOME/local --with-
libxml-libs-prefix=$HOME/local --with-libxml-include-prefix=$HOME/
local --with-libxml-prefix=$HOME/local
make
make install
gem install nokogiri -- --with-xslt-dir=$HOME/local --with-xml2-dir=
$HOME/local
The output I get is:
Building native extensions. This could take a while...
ERROR: Error installing nokogiri:
ERROR: Failed to build gem native extension.
/usr/bin/ruby1.8 extconf.rb --with-xslt-dir=/home/dahjelle/local --
with-xml2-dir=/home/dahjelle/local
checking for iconv.h in /home/dahjelle/local/include,/home/dahjelle/
local/include,/opt/local/include,/opt/local/include,/opt/local/include/
libxml2,/usr/local/include,/usr/local/include/libxml2,/usr/include,/
usr/include/libxml2,/usr/include,/usr/include/libxml2... yes
checking for libxml/parser.h in /home/dahjelle/local/include,/home/
dahjelle/local/include,/opt/local/include,/opt/local/include,/opt/
local/include/libxml2,/usr/local/include,/usr/local/include/libxml2,/
usr/include,/usr/include/libxml2,/usr/include,/usr/include/libxml2...
yes
checking for libxslt/xslt.h in /home/dahjelle/local/include,/home/
dahjelle/local/include,/opt/local/include,/opt/local/include,/opt/
local/include/libxml2,/usr/local/include,/usr/local/include/libxml2,/
usr/include,/usr/include/libxml2,/usr/include,/usr/include/libxml2...
yes
checking for libexslt/exslt.h in /home/dahjelle/local/include,/home/
dahjelle/local/include,/opt/local/include,/opt/local/include,/opt/
local/include/libxml2,/usr/local/include,/usr/local/include/libxml2,/
usr/include,/usr/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.
Yet even using nm on the libxslt.so file shows that the
xsltParseStylesheetDoc function exists, so it is rather unclear what
is going on.
The mkmf.log shows:
find_library: checking for xsltParseStylesheetDoc() in lxslt...
-------------------- no
"cc -o conftest -I/home/dahjelle/local/include -I/usr/include/libxml2 -
I/usr/include -I. -I/usr/lib/ruby/1.8/x86_64-linux -I. -I/home/me/
local/include -I/opt/local/include -fno-strict-aliasing -g -g -O2 -
fPIC -g -DXP_UNIX -O3 -Wall -Wcast-qual -Wwrite-strings -
Wconversion -Wmissing-noreturn -Winline conftest.c -L. -L/usr/lib -L/
home/me/local/lib -L/opt/local/lib -L. -rdynamic -Wl,-export-
dynamic -lxml2 -lruby1.8-static -lxslt -lxml2 -lpthread -ldl -
lcrypt -lm -lc"
conftest.c: In function ‘t’:
conftest.c:3: error: ‘xsltParseStylesheetDoc’ undeclared (first use in
this function)
conftest.c:3: error: (Each undeclared identifier is reported only
once
conftest.c:3: error: for each function it appears in.)
checked program was:
/* begin */
1: /*top*/
2: int main() { return 0; }
3: int t() { void ((*volatile p)()); p = (void ((*)()))
xsltParseStylesheetDoc; return 0; }
/* end */
Which doesn't help a lot more. It almost looks like I'm not making the
right specifications in the gem install command, but no other
combinations I've tired have worked, either.
It complicates things that libxml2 is installed on Dreamhost, but as
an outdated version.
Any suggestions or help are greatly appreciated.
David