[MacRuby-devel] Building MacRuby r2765 with llvm r82747 failed on core duo macbook, Leopard

Vincent Isambart vincent.isambart at gmail.com
Sun Oct 11 19:42:51 PDT 2009

> At the line around 100 of bin/rubyc:
>    init_func = "MREP_#{File.read(path).hash}"
> I extracted this line and execute it with -e option
> $ ./miniruby -I. -I./lib -e "p File.read('rbconfig.rb').hash"
> -107041289
> I suppose that String#hash method will return an integer, that could
> be nagative value. I don't know why on other environments
> the method return positive value everytime...

Laurent, wouldn't it be better to use something like a SHA1:
require 'digest/sha1'
init_func = "MREP_#{Digest::SHA1.hexdigest(File.read(path))}"

More information about the MacRuby-devel mailing list