v1.9.8: require "ffi" fails in OS X 10.10.3 & 10.9.5

22 views
Skip to first unread message

Chris Lasell

unread,
Jun 23, 2015, 1:45:28 PM6/23/15
to ruby...@googlegroups.com
Hello all,

Googling around I haven't found any mention of this, so I'm writing here.

I recently isntalled ruby ffi as a dependency of another project (and will be investigating it more deeply soon :-)  but notice that after a successful installation via 'gem install ffi'  requiring ffi fails with this in the OS default ruby 2.0.0:

irb(main):001:0> require 'ffi'
LoadError: cannot load such file -- ffi_c
from /Library/Ruby/Site/2.0.0/rubygems/custom_require.rb:36:in `require'
from /Library/Ruby/Site/2.0.0/rubygems/custom_require.rb:36:in `require'
from /Library/Ruby/Gems/2.0.0/gems/ffi-1.9.8/lib/ffi.rb:18:in `rescue in <top (required)>'
from /Library/Ruby/Gems/2.0.0/gems/ffi-1.9.8/lib/ffi.rb:3:in `<top (required)>'
from /Library/Ruby/Site/2.0.0/rubygems/custom_require.rb:60:in `require'
from /Library/Ruby/Site/2.0.0/rubygems/custom_require.rb:60:in `rescue in require'
from /Library/Ruby/Site/2.0.0/rubygems/custom_require.rb:35:in `require'
from (irb):1
from /usr/bin/irb:12:in `<main>'



Poking around looking for the missing ffi_c, I found ffi_c.bundle located in /Library/Ruby/Gems/2.0.0/gems/ffi-1.9.8/lib/Library/Ruby/Site/2.0.0/universal-darwin14


That path looking suspiciously like the standard OS X Ruby Site directory, I did this:



ln -s /Library/Ruby/Gems/2.0.0/gems/ffi-1.9.8/lib/Library/Ruby/Site/2.0.0/universal-darwin14/ffi_c.bundle  /Library/Ruby/Site/2.0.0/universal-darwin14/ffi_c.bundle

and it now loads just fine.


My ruby environment on my test machine is pretty standard, out of the box.   I've replicated this behavior, and fix, on a Mavericks (10.9.5) machine, with the universal-darwin13 directory.


Any thoughts?


Thanks!

-Chris

Reply all
Reply to author
Forward
0 new messages