Problem installing on Snow Leopard

29 views
Skip to first unread message

Joe C

unread,
Jun 25, 2009, 1:24:01 PM6/25/09
to nokogiri-talk
Hey, getting the following error when doing a "sudo gem install
nokogiri":

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... no
iconv is missing. try 'port install iconv' or 'yum install iconv'
*** 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.


A couple of things:

1) which iconv => /usr/bin/iconv
2) No mkmf.log exists anywhere


Any ideas on how to proceed?

Aaron Patterson

unread,
Jun 25, 2009, 2:00:57 PM6/25/09
to nokogi...@googlegroups.com

I've had a couple other reports similar to this. :-(

I'm looking in to it, and I'll reply to this as soon as I get more info.

--
Aaron Patterson
http://tenderlovemaking.com/

Joe C

unread,
Jun 25, 2009, 2:33:39 PM6/25/09
to nokogiri-talk
Hey Aaron, thanks!

That's what I get for early adoption - but I just couldn't resist the
shiny little package sitting on my desk.

It may have to do with the default compiler on snow leopard switching
from 32-bit to 64-bit. If my hacking turns anything up I'll be sure
to let you know.

Joe

On Jun 25, 2:00 pm, Aaron Patterson <aaron.patter...@gmail.com> wrote:

Aaron Patterson

unread,
Jun 25, 2009, 2:42:19 PM6/25/09
to nokogi...@googlegroups.com
On Thu, Jun 25, 2009 at 11:33 AM, Joe C<joe.c...@gmail.com> wrote:
>
> Hey Aaron, thanks!
>
> That's what I get for early adoption - but I just couldn't resist the
> shiny little package sitting on my desk.
>
> It may have to do with the default compiler on snow leopard switching
> from 32-bit to 64-bit.  If my hacking turns anything up I'll be sure
> to let you know.

Thanks! I've had people successfully build from git on 32 and 64 bit
snow leopard, but I haven't tested gem installation.

I don't have an ADC membership, so testing on Snow Leopard is
challenging, but I have my ways.

Aaron Patterson

unread,
Jun 26, 2009, 3:03:21 PM6/26/09
to nokogi...@googlegroups.com
On Thu, Jun 25, 2009 at 11:33 AM, Joe C<joe.c...@gmail.com> wrote:
>
> Hey Aaron, thanks!
>
> That's what I get for early adoption - but I just couldn't resist the
> shiny little package sitting on my desk.
>
> It may have to do with the default compiler on snow leopard switching
> from 32-bit to 64-bit.  If my hacking turns anything up I'll be sure
> to let you know.

You wouldn't happen to have macports installed with libxml2?

Joe C

unread,
Jun 27, 2009, 1:36:17 PM6/27/09
to nokogiri-talk
There is a very old install of libxml2 from macports on the machine,
but I doubt it is being used. In fact, I ran a:

sudo find / -type d -name "libxml2"

And got quite a list back:
/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.0.sdk/
usr/include/libxml2
/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.1.sdk/
usr/include/libxml2
/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/
iPhoneOS2.2.1.sdk/usr/include/libxml2
/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.2.sdk/
usr/include/libxml2
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/
iPhoneSimulator2.0.sdk/usr/include/libxml2
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/
iPhoneSimulator2.1.sdk/usr/include/libxml2
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/
iPhoneSimulator2.2.1.sdk/usr/include/libxml2
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/
iPhoneSimulator2.2.sdk/usr/include/libxml2
/Developer/SDKs/MacOSX10.4u.sdk/usr/include/libxml2
/Developer/SDKs/MacOSX10.5.sdk/usr/include/libxml2
/opt/local/var/macports/sources/rsync.macports.org/release/ports/
textproc/libxml2
/usr/share/gtk-doc/html/libxml2



On Jun 26, 3:03 pm, Aaron Patterson <aaron.patter...@gmail.com> wrote:

Aaron Patterson

unread,
Jun 27, 2009, 2:13:15 PM6/27/09
to nokogi...@googlegroups.com
On Sat, Jun 27, 2009 at 10:36 AM, Joe C<joe.c...@gmail.com> wrote:
>
> There is a very old install of libxml2 from macports on the machine,
> but I doubt it is being used.  In fact, I ran a:

No. Nokogiri will try to use the macports version of libxml2 before
it tries to use the system version. Try uninstalling the libxml2 that
is in macports, then try installing nokogiri.

It's *supposed* to gracefully degrade to the system version if it
can't use the macports version, but I don't think that is happening.

Joe C

unread,
Jun 30, 2009, 10:41:50 AM6/30/09
to nokogiri-talk
Ok thanks, I'll give that a whirl and report my findings.

On Jun 27, 2:13 pm, Aaron Patterson <aaron.patter...@gmail.com> wrote:

Joe C

unread,
Jun 30, 2009, 11:26:54 AM6/30/09
to nokogiri-talk
I zapped the macports version of libxml2 and still no go.

There error message from above indicates no iconv, so I checked my /
usr/lib for both libxml2 and iconv, here are the results:
/usr/lib # ls -la libx*
-rwxr-xr-x 1 root wheel 276784 May 18 15:34 libxar.1.dylib
lrwxr-xr-x 1 root wheel 14 Jun 15 11:50 libxar.dylib -> libxar.
1.dylib
lrwxr-xr-x 1 root wheel 15 Jun 15 11:50 libxml2.2.7.3.dylib ->
libxml2.2.dylib
-rwxr-xr-x 1 root wheel 3758272 May 28 18:40 libxml2.2.dylib
lrwxr-xr-x 1 root wheel 15 Jun 15 11:50 libxml2.dylib ->
libxml2.2.dylib
-rwxr-xr-x 1 root wheel 648832 May 18 14:10 libxslt.1.dylib
lrwxr-xr-x 1 root wheel 15 Jun 15 11:50 libxslt.dylib ->
libxslt.1.dylib

/usr/lib # ls -la *icon*
lrwxr-xr-x 1 root wheel 16 Jun 15 11:50 libiconv.2.4.0.dylib -
> libiconv.2.dylib
-rw-r--r-- 1 root wheel 3098592 May 18 19:09 libiconv.2.dylib
lrwxr-xr-x 1 root wheel 20 Jun 15 11:50 libiconv.dylib ->
libiconv.2.4.0.dylib

I also decided to check if somehow iconv was compiled for 64-bit
clean, but it includes multiple architectures (including 32-bit):
/usr/lib # file libiconv.2.dylib
libiconv.2.dylib: Mach-O universal binary with 3 architectures
libiconv.2.dylib (for architecture x86_64): Mach-O 64-bit dynamically
linked shared library x86_64
libiconv.2.dylib (for architecture i386): Mach-O dynamically linked
shared library i386
libiconv.2.dylib (for architecture ppc7400): Mach-O dynamically linked
shared library ppc

I went back and reread my error message and it is telling me it can't
find the header file iconv.h, so I decided to look for that. Here's
what I got:
/usr/lib # sudo find / -name iconv.h -type file
/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.0.sdk/
usr/include/iconv.h
/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.1.sdk/
usr/include/iconv.h
/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/
iPhoneOS2.2.1.sdk/usr/include/iconv.h
/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.2.sdk/
usr/include/iconv.h
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/
iPhoneSimulator2.0.sdk/usr/include/iconv.h
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/
iPhoneSimulator2.1.sdk/usr/include/iconv.h
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/
iPhoneSimulator2.2.1.sdk/usr/include/iconv.h
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/
iPhoneSimulator2.2.sdk/usr/include/iconv.h
/Developer/SDKs/MacOSX10.4u.sdk/usr/include/iconv.h
/Developer/SDKs/MacOSX10.5.sdk/usr/include/iconv.h

Joe C

unread,
Jun 30, 2009, 5:28:35 PM6/30/09
to nokogiri-talk
Success!

I had done an upgrade install of Snow Leopard and decided to reload
from scratch.

- Re-installed Snow Leopard after deleting out /Library and such
- Installed XCode
- Ran Software Update
- Re-installed Ruby/Gems (hate using apples version used this howto:
http://hivelogic.com/articles/view/ruby-rails-leopard)

$ sudo gem install nokogiri
Building native extensions. This could take a while...
Successfully installed nokogiri-1.3.2
1 gem installed
Installing ri documentation for nokogiri-1.3.2...
Installing RDoc documentation for nokogiri-1.3.2...
Reply all
Reply to author
Forward
0 new messages