Skip to content


Subversion checkout URL

You can clone with
Download ZIP


FFI problem in Ruby 1.9.3 Travis environment #573

celldee opened this Issue · 3 comments

2 participants


I am seeing an issue with a GitHub project of mine - celldee/ffi-rxs - where the test suite fails when run on Travis in a Ruby 1.9.3 environment.

When I look at the trace on Travis, I can see that bundle install works correctly, however, the 'ruby -S rspec' command fails when trying to require 'libc.rb' from the source. libc.rb contains a module LibC that extends FFI::Library like this -

module LibC
extend FFI::Library

It appears that the failure is occurring on the 'extend' with -

'module:LibC': uninitialized constant LibC::FFI (NameError)

I have tried to recreate the problem on my own machine but have had no success. The test suite runs on Travis in Ruby 1.9.2, JRuby 1.8, JRuby 1.9, rbx 1.8 and rbx 1.9 environments.

I have made various changes to see if I could find a fix in the code but they made no difference and after completing numerous Travis runs I am out of ideas.

Does anyone have any idea what the problem might be?

If I can assist with further information please let me know.


@celldee Looks like you got this fixed.

For the record: Add this to your .travis.yml file to fix this:

before_install: echo 'yes' | gem uninstall ffi -a -I || true

Thanks. I added it as a 'before_install' command, as advised by Michael Klishin, and it works as expected now.


Ah, yes, of course it's before_install, sorry about that. Updated my earlier comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.