Sometimes I wonder if FreeBSD hates me… It’s that case. FreeBSD guys have done something to ruby.
irb(main):001:0> require ‘rubygems’
=> true
irb(main):002:0> require ‘hpricot’
=> true
irb(main):003:0> Hpricot(’ <dd> <dl> <ul> <li> ’*200 + ’ </li> </ul> </dl< </dd> ’*200)
Illegal instruction: 4
I can successfully run this code on Mac OS X and Linux, but it fails on every FreeBSD I tried. Technically it’s not hpricot’s bug. If you also have this issue you can try my hackaround for hpricot 0.6.164. It’s a bit slower than original version, but doesn’t kills ruby on FreeBSD.
UPDATE: It’s still doesn’t work… Hpricot parses ok, but .at fails with the same stack overflow.
UPDATE: Finally, I found the solution:
curl ftp://ftp.ruby-lang.org:21//pub/ruby/1.8/ruby-1.8.6-p287.tar.bz2 -o ruby-1.8.6-p287.tar.bz2 && \
curl http://de.mirror.rubyforge.org/rubygems/rubygems-1.3.1.tgz -o rubygems-1.3.1.tgz && \
tar -jxvf ruby-1.8.6-p287.tar.bz2 && \
tar -zxvf rubygems-1.3.1.tgz && \
cd ruby-1.8.6-p287 && \
./configure —prefix=/usr/local/ruby186 —with-iconv-dir=/usr/local && \
make all install && \
cd .. && \
cd rubygems-1.3.1 && \
/usr/local/ruby186/bin/ruby setup.rb && \
/usr/local/ruby186/bin/gem install hpricot
It’s the second time when freebsd ports installs me software with bad patches… Anybody, please consider do not installing freebsd… Let it die