Ticket #132 (new defect)

Opened 5 months ago

Last modified 5 months ago

Can't install hpricot gem on Ruby 1.9

Reported by: znmeb Owned by: why
Priority: minor Milestone:
Component: ext/hpricot_scan Version:
Keywords: 1.9 extension Cc:

Description

I've just built Ruby 1.9 in a local user account (not root) on a Linux system. I tried to install the hpricot gem, but the C extension didn't compile. I think this is something simple, like a missing path or environment variable.

$ gem install hpricot

Building native extensions. This could take a while... ERROR: Error installing hpricot:

ERROR: Failed to build gem native extension.

/home/znmeb/cougar/ruby-1.9-testing/install/bin/ruby extconf.rb install hpricot checking for main() in -lc... yes creating Makefile

make gcc -I. -I/home/znmeb/cougar/ruby-1.9-testing/install/include/ruby-1.9/x86_64-linux -I/home/znmeb/cougar/ruby-1.9-testing/install/include/ruby-1.9 -I. -fPIC -march=athlon64 -O3 -o hpricot_scan.o -c hpricot_scan.c ext/hpricot_scan/hpricot_scan.rl: In function 'hpricot_scan': ext/hpricot_scan/hpricot_scan.rl:172: error: 'struct RString' has no member named 'ptr' ext/hpricot_scan/hpricot_scan.rl:185: error: 'struct RString' has no member named 'ptr' ext/hpricot_scan/hpricot_scan.rl:185: error: 'struct RString' has no member named 'len' ext/hpricot_scan/hpricot_scan.rl:186: error: 'struct RString' has no member named 'len' ext/hpricot_scan/hpricot_scan.rl:202: error: 'struct RString' has no member named 'ptr' make: *** [hpricot_scan.o] Error 1

Gem files will remain installed in /home/znmeb/cougar/ruby-1.9-testing/install/lib/ruby/gems/1.9/gems/hpricot-0.6 for inspection. Results logged to /home/znmeb/cougar/ruby-1.9-testing/install/lib/ruby/gems/1.9/gems/hpricot-0.6/ext/hpricot_scan/gem_make.out

Attachments

Rakefile (6.4 kB) - added by manveru 5 months ago.
Rakefile
extconf.rb (365 bytes) - added by manveru 5 months ago.
ext/hpricot_scan/extconf.rb

Change History

Changed 5 months ago by manveru

Rakefile

Changed 5 months ago by manveru

ext/hpricot_scan/extconf.rb

Changed 5 months ago by manveru

I just spent a while to port Hpricot to ruby 1.9 and finally had success. The gem can be found at

http://weez-int.com/gem/hpricot-0.6.gem

But more important i think is to share information on how to create the gem, here are the:

fixed ext/hpricot_scan/extconf.rb: http://p.ramaze.net/19

fixed Rakefile: http://p.ramaze.net/20

The files are also attached to this ticket.

The most important changes here are patching the C generated by ragel (i have no knowledge of ragel, that should be probably fixed on their side, i guess) and that ruby1.9 has no ::Config module anymore, it's RbConfig?.

manveru

Note: See TracTickets for help on using tickets.