Projects

Ticket #810 (closed defect: fixed)

Opened 19 months ago

Last modified 19 months ago

MacRuby can't install the nokogiri of rubygems.

Reported by: watson1978@… Owned by: lsansonetti@…
Priority: blocker Milestone: MacRuby 0.7
Component: MacRuby Keywords:
Cc:

Description

$ sudo macgem install nokogiri
---snip---
In file included from ./html_document.h:4,
                 from html_document.c:1:
./nokogiri.h:35:16: error: st.h: No such file or directory
make: *** [html_document.o] Error 1


Gem files will remain installed in /Library/Frameworks/MacRuby.framework/Versions/0.7/usr/lib/ruby/Gems/1.9.2/gems/nokogiri-1.4.2 for inspection.
Results logged to /Library/Frameworks/MacRuby.framework/Versions/0.7/usr/lib/ruby/Gems/1.9.2/gems/nokogiri-1.4.2/ext/nokogiri/gem_make.out

To install the nokogiri, the following operation is necessary.

$ echo '#include "ruby/st.h"' > st.h
$ sudo mv st.h /Library/Frameworks/MacRuby.framework/Versions/Current/usr/include/ruby-1.9.2

$ sudo macgem install nokogiri                                                              
unknown: warning: ignoring alias
unknown: warning: ignoring alias
unknown: warning: ignoring alias
unknown: warning: ignoring alias
unknown: warning: ignoring alias
unknown: warning: ignoring alias
Building native extensions.  This could take a while...
Successfully installed nokogiri-1.4.2
1 gem installed

Change History

Changed 19 months ago by lsansonetti@…

  • status changed from new to closed
  • resolution set to invalid

It's a bug of Nokogiri (in Ruby 1.9, #include <ruby/st.h> must be used instead of #include <st.h>. I reported this problem a few months ago to the maintain who fixed it in top-of-tree, but it still has not been released as a new gem yet.

Changed 19 months ago by lsansonetti@…

  • status changed from closed to reopened
  • resolution invalid deleted

Re-opening the ticket. It looks like the fix was released, but nokogiri cannot identify MacRuby as 1.9 because it doesn't define HAVE_RUBY_ENCODING_H. When defining this variable, the build fails later because nokogiri makes use of the encoding.h API and we miss some symbols.

Changed 19 months ago by lsansonetti@…

  • status changed from reopened to closed
  • resolution set to fixed
  • milestone set to MacRuby 0.7

Okay, the gem should not build and load with r4380.

Note that I wasn't able to run the frontpage example in nokogiri.org, at a quick glance it seems to be related to the fact that it passes freshly created ruby objects as context pointers to libxml and our GC won't determine if the object is still used, therefore it collects it, then the process crashes later when trying to use that object. I will look later (I also suspect this can be a problem with the GC of MRI), in the meantime, this bug can be closed!

Changed 19 months ago by lsansonetti@…

Of course I meant "the gem should _now_ build and load" :-)

Note: See TracTickets for help on using tickets.