Skip to content

Instantly share code, notes, and snippets.

@pepe
Created April 29, 2011 06:54
Show Gist options
  • Save pepe/947959 to your computer and use it in GitHub Desktop.
Save pepe/947959 to your computer and use it in GitHub Desktop.
CityHash on MacOS X with ruby 1.9.2 from rvm
>> require 'cityhash'
LoadError: Could not open library '/Users/pepe/.rvm/gems/ruby-1.9.2-p180/gems/cityhash-0.4.0/lib/cityhash/ext/libcity.so': dlopen(/Users/pepe/.rvm/gems/ruby-1.9.2-p180/gems/cityhash-0.4.0/lib/cityhash/ext/libcity.so, 5): no suitable image found. Did find:
/Users/pepe/.rvm/gems/ruby-1.9.2-p180/gems/cityhash-0.4.0/lib/cityhash/ext/libcity.so: unknown file type, first eight bytes: 0x7F 0x45 0x4C 0x46 0x01 0x01 0x01 0x00
from /Users/pepe/.rvm/gems/ruby-1.9.2-p180/gems/ffi-1.0.7/lib/ffi/library.rb:75:in `block in ffi_lib'
from /Users/pepe/.rvm/gems/ruby-1.9.2-p180/gems/ffi-1.0.7/lib/ffi/library.rb:54:in `map'
from /Users/pepe/.rvm/gems/ruby-1.9.2-p180/gems/ffi-1.0.7/lib/ffi/library.rb:54:in `ffi_lib'
from /Users/pepe/.rvm/gems/ruby-1.9.2-p180/gems/cityhash-0.4.0/lib/cityhash.rb:11:in `<module:Internal>'
from /Users/pepe/.rvm/gems/ruby-1.9.2-p180/gems/cityhash-0.4.0/lib/cityhash.rb:8:in `<module:CityHash>'
from /Users/pepe/.rvm/gems/ruby-1.9.2-p180/gems/cityhash-0.4.0/lib/cityhash.rb:3:in `<top (required)>'
from <internal:lib/rubygems/custom_require>:33:in `require'
from <internal:lib/rubygems/custom_require>:33:in `rescue in require'
from <internal:lib/rubygems/custom_require>:29:in `require'
from (irb):1
from /Users/pepe/.rvm/rubies/ruby-1.9.2-p180/bin/irb:16:in `<main>'
@charlesmartin14
Copy link

I had the same problem. There is a bug in the C code where ssize_t is appears instead of size_t
This is why it does not compile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment