Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't install on fresh Ubuntu 16.04 #512

Closed
abitrolly opened this issue Jun 7, 2017 · 4 comments
Closed

Can't install on fresh Ubuntu 16.04 #512

abitrolly opened this issue Jun 7, 2017 · 4 comments

Comments

@abitrolly
Copy link

$ apt-get install ruby ruby-dev
$ ruby -v
ruby 2.3.1p112 (2016-04-26) [x86_64-linux-gnu]
$ 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 ./siteconf20170607-1134-1b5l7zm.rb extconf.rb
checking for ffi.h... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
        --with-opt-dir
        --without-opt-dir
        --with-opt-include
        --without-opt-include=${opt-dir}/include
        --with-opt-lib
        --without-opt-lib=${opt-dir}/lib
        --with-make-prog
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=/usr/bin/$(RUBY_BASE_NAME)2.3
        --with-ffi_c-dir
        --without-ffi_c-dir
        --with-ffi_c-include
        --without-ffi_c-include=${ffi_c-dir}/include
        --with-ffi_c-lib
        --without-ffi_c-lib=${ffi_c-dir}/lib
        --with-libffi-config
        --without-libffi-config
        --with-pkg-config
        --without-pkg-config
/usr/lib/ruby/2.3.0/mkmf.rb:456:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
        from /usr/lib/ruby/2.3.0/mkmf.rb:587:in `try_cpp'
        from /usr/lib/ruby/2.3.0/mkmf.rb:1091:in `block in have_header'
        from /usr/lib/ruby/2.3.0/mkmf.rb:942:in `block in checking_for'
        from /usr/lib/ruby/2.3.0/mkmf.rb:350:in `block (2 levels) in postpone'
        from /usr/lib/ruby/2.3.0/mkmf.rb:320:in `open'
        from /usr/lib/ruby/2.3.0/mkmf.rb:350:in `block in postpone'
        from /usr/lib/ruby/2.3.0/mkmf.rb:320:in `open'
        from /usr/lib/ruby/2.3.0/mkmf.rb:346:in `postpone'
        from /usr/lib/ruby/2.3.0/mkmf.rb:941:in `checking_for'
        from /usr/lib/ruby/2.3.0/mkmf.rb:1090:in `have_header'
        from extconf.rb:16:in `<main>'

To see why this extension failed to compile, please check the mkmf.log which can be found here:

  /var/lib/gems/2.3.0/extensions/x86_64-linux/2.3.0/ffi-1.9.18/mkmf.log

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/x86_64-linux/2.3.0/ffi-1.9.18/gem_make.out
@Spongman
Copy link

i just get this:

$ gem install travis -v 1.8.8 --no-rdoc --no-ri
ERROR:  While executing gem ... (Gem::FilePermissionError)
    You don't have write permissions for the /var/lib/gems/2.3.0 directory.

not sure how to proceed.

@jmcdo29
Copy link

jmcdo29 commented Jan 31, 2019

I'm running into the same issue. When I try to run sudo gem install travis -v 1.8.9 --no-rdoc --no-ri I get a failure. Looking at the mkmf.log it looks like the stdio.h file is missing somehow.

"pkg-config --exists libffi"
package configuration for libffi is not found
"gcc -o conftest -I/usr/include/x86_64-linux-gnu/ruby-2.5.0 -I/usr/include/ruby-2.5.0/ruby/backward -I/usr/include/ruby-2.5.0 -I. -Wdate-time -D_FORTIFY_SOURCE=2   -g -O2 -fdebug-prefix-map=/build/ruby2.5-VnpVLW/ruby2.5-2.5.1=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC conftest.c  -L. -L/usr/lib/x86_64-linux-gnu -L. -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -fstack-protector -rdynamic -Wl,-export-dynamic     -lruby-2.5  -lpthread -lgmp -ldl -lcrypt -lm   -lc"
In file included from /usr/include/ruby-2.5.0/ruby/ruby.h:29:0,
                 from /usr/include/ruby-2.5.0/ruby.h:33,
                 from conftest.c:1:
/usr/include/ruby-2.5.0/ruby/defines.h:112:10: fatal error: stdio.h: No such file or directory
 #include <stdio.h>
          ^~~~~~~~~
compilation terminated.
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: int main(int argc, char **argv)
4: {
5:   return 0;
6: }
/* end */

@jmcdo29
Copy link

jmcdo29 commented Feb 5, 2019

As it turns out for myself, I had an out-of-date version of build-essentials. Running sudo apt-get install build-essentials fixed this for me.

@BanzaiMan
Copy link
Contributor

Closing in favor of #758. It no longer depends on native extensions, so the installation should be easier. If the issue persists, feel free to open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants