[MacRuby] #810: MacRuby can't install the nokogiri of rubygems.
#810: MacRuby can't install the nokogiri of rubygems. ----------------------------------+----------------------------------------- Reporter: watson1978@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: Component: MacRuby | Keywords: ----------------------------------+----------------------------------------- {{{ $ 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 }}} -- Ticket URL: <http://www.macruby.org/trac/ticket/810> MacRuby <http://macruby.org/>
#810: MacRuby can't install the nokogiri of rubygems. ----------------------------------+----------------------------------------- Reporter: watson1978@… | Owner: lsansonetti@… Type: defect | Status: closed Priority: blocker | Milestone: Component: MacRuby | Resolution: invalid Keywords: | ----------------------------------+----------------------------------------- Changes (by lsansonetti@…): * status: new => closed * resolution: => invalid Comment: 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. -- Ticket URL: <http://www.macruby.org/trac/ticket/810#comment:1> MacRuby <http://macruby.org/>
On Sat, Jul 24, 2010 at 06:46:27PM -0000, MacRuby wrote:
#810: MacRuby can't install the nokogiri of rubygems. ----------------------------------+----------------------------------------- Reporter: watson1978@… | Owner: lsansonetti@… Type: defect | Status: closed Priority: blocker | Milestone: Component: MacRuby | Resolution: invalid Keywords: | ----------------------------------+----------------------------------------- Changes (by lsansonetti@…):
* status: new => closed * resolution: => invalid
Comment:
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.
Actually, we've fixed this months ago: http://github.com/tenderlove/nokogiri/commit/602720e6 The problem is that MacRuby doesn't have a HAVE_RUBY_ENCODING_H constant. In Ruby 1.8, the correct thing is to include "st.h". In 1.9, we must include "ruby/st.h". The way we determine which to use is by looking for HAVE_RUBY_ENCODING_H. HAVE_RUBY_ENCODING_H is defined in 1.9, but not in 1.8. I'm happy to add an extra switch to the header file if there is something special I can do for MacRuby. -- Aaron Patterson http://tenderlovemaking.com/
Hi Aaron, On Jul 24, 2010, at 3:35 PM, Aaron Patterson wrote:
On Sat, Jul 24, 2010 at 06:46:27PM -0000, MacRuby wrote:
#810: MacRuby can't install the nokogiri of rubygems. ----------------------------------+----------------------------------------- Reporter: watson1978@… | Owner: lsansonetti@… Type: defect | Status: closed Priority: blocker | Milestone: Component: MacRuby | Resolution: invalid Keywords: | ----------------------------------+----------------------------------------- Changes (by lsansonetti@…):
* status: new => closed * resolution: => invalid
Comment:
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.
Actually, we've fixed this months ago:
http://github.com/tenderlove/nokogiri/commit/602720e6
The problem is that MacRuby doesn't have a HAVE_RUBY_ENCODING_H constant. In Ruby 1.8, the correct thing is to include "st.h". In 1.9, we must include "ruby/st.h". The way we determine which to use is by looking for HAVE_RUBY_ENCODING_H. HAVE_RUBY_ENCODING_H is defined in 1.9, but not in 1.8.
Indeed! I thought that the fix didn't actually make into a gem release yet, but I was mistaken. I am going to work on making sure nokogiri builds fine with MacRuby now, I re-opened the ticket #810. Thanks for commenting :) Laurent
On Sat, Jul 24, 2010 at 05:34:23PM -0700, Laurent Sansonetti wrote:
Hi Aaron,
On Jul 24, 2010, at 3:35 PM, Aaron Patterson wrote:
On Sat, Jul 24, 2010 at 06:46:27PM -0000, MacRuby wrote:
#810: MacRuby can't install the nokogiri of rubygems. ----------------------------------+----------------------------------------- Reporter: watson1978@… | Owner: lsansonetti@… Type: defect | Status: closed Priority: blocker | Milestone: Component: MacRuby | Resolution: invalid Keywords: | ----------------------------------+----------------------------------------- Changes (by lsansonetti@…):
* status: new => closed * resolution: => invalid
Comment:
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.
Actually, we've fixed this months ago:
http://github.com/tenderlove/nokogiri/commit/602720e6
The problem is that MacRuby doesn't have a HAVE_RUBY_ENCODING_H constant. In Ruby 1.8, the correct thing is to include "st.h". In 1.9, we must include "ruby/st.h". The way we determine which to use is by looking for HAVE_RUBY_ENCODING_H. HAVE_RUBY_ENCODING_H is defined in 1.9, but not in 1.8.
Indeed! I thought that the fix didn't actually make into a gem release yet, but I was mistaken. I am going to work on making sure nokogiri builds fine with MacRuby now, I re-opened the ticket #810.
Yay! Thanks! Does this mean that MacRuby will support the 1.9 encoding C API?
Thanks for commenting :)
No problem! :-) -- Aaron Patterson http://tenderlovemaking.com/
#810: MacRuby can't install the nokogiri of rubygems. ----------------------------------+----------------------------------------- Reporter: watson1978@… | Owner: lsansonetti@… Type: defect | Status: reopened Priority: blocker | Milestone: Component: MacRuby | Resolution: Keywords: | ----------------------------------+----------------------------------------- Changes (by lsansonetti@…): * status: closed => reopened * resolution: invalid => Comment: 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. -- Ticket URL: <http://www.macruby.org/trac/ticket/810#comment:2> MacRuby <http://macruby.org/>
#810: MacRuby can't install the nokogiri of rubygems. ----------------------------------+----------------------------------------- Reporter: watson1978@… | Owner: lsansonetti@… Type: defect | Status: closed Priority: blocker | Milestone: MacRuby 0.7 Component: MacRuby | Resolution: fixed Keywords: | ----------------------------------+----------------------------------------- Changes (by lsansonetti@…): * status: reopened => closed * resolution: => fixed * milestone: => MacRuby 0.7 Comment: 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! -- Ticket URL: <http://www.macruby.org/trac/ticket/810#comment:3> MacRuby <http://macruby.org/>
On Sun, Jul 25, 2010 at 12:58:48AM -0000, MacRuby wrote:
#810: MacRuby can't install the nokogiri of rubygems. ----------------------------------+----------------------------------------- Reporter: watson1978@… | Owner: lsansonetti@… Type: defect | Status: closed Priority: blocker | Milestone: MacRuby 0.7 Component: MacRuby | Resolution: fixed Keywords: | ----------------------------------+----------------------------------------- Changes (by lsansonetti@…):
* status: reopened => closed * resolution: => fixed * milestone: => MacRuby 0.7
Comment:
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!
Awesome! Thank you very much. We definitely store VALUE pointers in internal libxml2 data structures, but those should be pointed to by Ruby too (I think). I'll build the latest MacRuby and see what I can find. -- Aaron Patterson http://tenderlovemaking.com/
#810: MacRuby can't install the nokogiri of rubygems. ----------------------------------+----------------------------------------- Reporter: watson1978@… | Owner: lsansonetti@… Type: defect | Status: closed Priority: blocker | Milestone: MacRuby 0.7 Component: MacRuby | Resolution: fixed Keywords: | ----------------------------------+----------------------------------------- Comment(by lsansonetti@…): Of course I meant "the gem should _now_ build and load" :-) -- Ticket URL: <http://www.macruby.org/trac/ticket/810#comment:4> MacRuby <http://macruby.org/>
participants (3)
-
Aaron Patterson
-
Laurent Sansonetti
-
MacRuby