Project

General

Profile

Bundler installation fails on Ubuntu Xenial

Added by M Wagner about 8 years ago

hi everyone,

i followed this guide on a Ubuntu Xenial, but get stuck at this point when invoking bundler install --without development test.

the packages ruby-dev, libmysqlclient-dev and imagemagick are installed from the Ubuntu repositories. locate thread.h returns /usr/include/ruby-2.3.0/ruby/thread.h among other results, locate ruby.h yields /usr/include/ruby-2.3.0/ruby.h and /usr/include/ruby-2.3.0/ruby/ruby.h.

the command mentioned above fails with this output:

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory: /var/lib/gems/2.3.0/gems/mysql2-0.3.21/ext/mysql2
/usr/bin/ruby2.3 -r ./siteconf20161121-20539-bz7l20.rb extconf.rb
checking for ruby/thread.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
/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:15: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/mysql2-0.3.21/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /var/lib/gems/2.3.0/gems/mysql2-0.3.21 for inspection.
Results logged to /var/lib/gems/2.3.0/extensions/x86_64-linux/2.3.0/mysql2-0.3.21/gem_make.out

An error occurred while installing mysql2 (0.3.21), and Bundler cannot continue.
Make sure that `gem install mysql2 -v '0.3.21'` succeeds before bundling.

this is the content of /var/lib/gems/2.3.0/extensions/x86_64-linux/2.3.0/mysql2-0.3.21/mkmf.log:

"gcc -o conftest -I/usr/include/x86_64-linux-gnu/ruby-2.3.0 -I/usr/include/ruby-2.3.0/ruby/backward -I/usr/include/ruby-2.3.0 -I. -Wdate-time -D_FORTIFY_SOURCE=2   -g -O2 -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.3  -lpthread -lgmp -ldl -lcrypt -lm   -lc" 
checked program was:
/* begin */
1: #include "ruby.h" 
2: 
3: int main(int argc, char **argv)
4: {
5:   return 0;
6: }
/* end */

my conclusion from the output would be that ruby.h and / or thread.h can't be located when the mysql2 gem is to be build. if so, how would i tell bundler where too look? or am i wrong with my interpretation?


Replies (1)

RE: Bundler installation fails on Ubuntu Xenial - Added by M Wagner about 8 years ago

my interpretation was wrong, the output is obviously misleading. after installing the packages libmagickcore-dev and libmagickwand-dev the installation succeeded.

    (1-1/1)