travis-ci / travis.rb

Travis CI Client (CLI and Ruby library)
MIT License
1.59k stars 408 forks source link

installing travis.rb throws an error #536

Open the-ashh opened 7 years ago

the-ashh commented 7 years ago

when trying to install travis.rb, this happens


# gem install travis -v 1.8.8 --no-rdoc --no-ri
Building native extensions.  This could take a while...
ERROR:  Error installing travis:
        ERROR: Failed to build gem native extension.

    current directory: /var/lib/gems/2.3.0/gems/ffi-1.9.18/ext/ffi_c
/usr/bin/ruby2.3 -r ./siteconf20170901-5728-gga3jv.rb extconf.rb
mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h

extconf failed, exit code 1

Gem files will remain installed in /var/lib/gems/2.3.0/gems/ffi-1.9.18 for inspection.
Results logged to /var/lib/gems/2.3.0/extensions/arm-linux/2.3.0/ffi-1.9.18/gem_make.out

what should i do now? attached is the .out file gem_make.txt

BanzaiMan commented 7 years ago

Your Ruby installation is missing a header file /usr/lib/ruby/include/ruby.h and can't compile FFI. Strictly speaking, this is not a problem with travis.rb.

the-ashh commented 7 years ago

ok then. do you have any suggestion to be able to fix this

BanzaiMan commented 7 years ago

@cooler9711 You'll need to have a working Ruby environment. If it's Ubuntu, for example, we have https://github.com/travis-ci/travis.rb#ubuntu. For other distros, I suspect the issue is similar; find a package that provides the header file you need to compile FFI.

KBortnick commented 5 years ago

Not to necro this, but since it's still open and google sent me here for this error initially:

As BanzaiMan pointed out, this problem happens when the ruby header files are missing. These exist in a separate package from the base ruby install, making it possible to have a "working" Ruby environment, but not able to compile extension modules. These headers exist in a -dev package for Debian / Ubuntu, and can be installed with:

sudo apt-get install ruby-dev

This is mentioned (without the accompanying error) in the main readme under Troubleshooting > Ubuntu (https://github.com/travis-ci/travis.rb#ubuntu)

I confirmed installing the above package resolved the problem posted for me, and this issue is probably safe to be closed.