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

(Solved) Installing bundler on Ubuntu 16.04: ffi and nokogiri #229

Closed
laurensvalk opened this issue Sep 5, 2016 · 1 comment
Closed

Comments

@laurensvalk
Copy link
Contributor

I had two issues performing the step

sudo gem install bundler

On Ubuntu 16.04. Apparently, ffi and nokogiri failed to build.

To fix it, [source 1, source 2] run:

sudo apt-get install ruby-dev
sudo apt-get install zlib1g-dev

And then installing bundler again completed successfully. Perhaps these two packages could be added to the apt-get instructions already in the readme. Also, the "2.0" packages "ruby2.0 ruby2.0-dev" don't seem to exist in 16.04.

For reference, the error messages are posted below.

Installing ffi 1.9.14 with native extensions

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

    current directory: /tmp/bundler20160905-5727-1ga529ffi-1.9.14/gems/ffi-1.9.14/ext/ffi_c
/usr/bin/ruby2.3 -r ./siteconf20160905-5727-mho9w6.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 /tmp/bundler20160905-5727-1ga529ffi-1.9.14/gems/ffi-1.9.14 for inspection.
Results logged to /tmp/bundler20160905-5727-1ga529ffi-1.9.14/extensions/x86_64-linux/2.3.0/ffi-1.9.14/gem_make.out

(...)

An error occurred while installing ffi (1.9.14), and Bundler cannot continue.
Make sure that `gem install ffi -v '1.9.14'` succeeds before bundling.
Installing nokogiri 1.6.8 with native extensions

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

    current directory: /tmp/bundler20160905-11974-ln6hq2nokogiri-1.6.8/gems/nokogiri-1.6.8/ext/nokogiri
/usr/bin/ruby2.3 -r ./siteconf20160905-11974-klmref.rb extconf.rb
Using pkg-config version 1.1.7
checking if the C compiler accepts ... yes
Building nokogiri using packaged libraries.
Using mini_portile version 2.1.0
checking for gzdopen() in -lz... no
zlib is missing; necessary for building libxml2
*** 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
    --help
    --clean
    --use-system-libraries
    --enable-static
    --disable-static
    --with-zlib-dir
    --without-zlib-dir
    --with-zlib-include
    --without-zlib-include=${zlib-dir}/include
    --with-zlib-lib
    --without-zlib-lib=${zlib-dir}/lib
    --enable-cross-build
    --disable-cross-build

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

  /tmp/bundler20160905-11974-ln6hq2nokogiri-1.6.8/extensions/x86_64-linux/2.3.0/nokogiri-1.6.8/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /tmp/bundler20160905-11974-ln6hq2nokogiri-1.6.8/gems/nokogiri-1.6.8 for inspection.
Results logged to /tmp/bundler20160905-11974-ln6hq2nokogiri-1.6.8/extensions/x86_64-linux/2.3.0/nokogiri-1.6.8/gem_make.out
@WasabiFan
Copy link
Member

Fixed in #231. Issue number was transcribed slightly incorrectly so it didn't close automatically. Thanks for the report!

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

No branches or pull requests

2 participants