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

Error when running bundle install on a fresh repo clone #52

Open
allanwsilva opened this issue Jan 26, 2018 · 6 comments
Open

Error when running bundle install on a fresh repo clone #52

allanwsilva opened this issue Jan 26, 2018 · 6 comments

Comments

@allanwsilva
Copy link

I'm a not ruby guy... can you please help with that?

Fetching nokogiri 1.8.0
Installing nokogiri 1.8.0 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory:
/home/xxxxxx/resume-template-gh-pages/_vendor/bundle/ruby/2.3.0/gems/nokogiri-1.8.0/ext/nokogiri
/usr/bin/ruby2.3 -r ./siteconf20180126-27073-6ovuox.rb extconf.rb
checking if the C compiler accepts ... yes
Building nokogiri using packaged libraries.
Using mini_portile version 2.2.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:

/home/xxxxxx/resume-template-gh-pages/_vendor/bundle/ruby/2.3.0/extensions/x86_64-linux/2.3.0/nokogiri-1.8.0/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in
/home/xxxxxx/resume-template-gh-pages/_vendor/bundle/ruby/2.3.0/gems/nokogiri-1.8.0
for inspection.
Results logged to
/home/xxxxxx/resume-template-gh-pages/_vendor/bundle/ruby/2.3.0/extensions/x86_64-linux/2.3.0/nokogiri-1.8.0/gem_make.out

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

In Gemfile:
  github-pages was resolved to 150, which depends on
    jekyll-mentions was resolved to 1.2.0, which depends on
      html-pipeline was resolved to 2.6.0, which depends on
        nokogiri
root@xxxxxx:/home/xxxxxx/resume-template-gh-pages# bundle exec jekyll serve
Could not find nokogiri-1.8.0 in any of the sources
Run `bundle install` to install missing gems.

Environment settings:

root@xxxxxx:/home/xxxxxx/resume-template-gh-pages# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 16.04.3 LTS
Release:        16.04
Codename:       xenial
@jglovier
Copy link
Owner

jglovier commented Feb 6, 2018

@allanwsilva hmm, I'm not familiar with this error. Do you get this when you run bundle install?

@jglovier
Copy link
Owner

jglovier commented Feb 6, 2018

Seeing that you're on Ubuntu, I wonder if it's an issue with compatibility of one of the gems or environment settings with Ubuntu?

@norm-l
Copy link

norm-l commented Apr 20, 2018

Hello, I received the same error on Ubuntu. You need to install some system libraries for nokogiri to work.

Run:
sudo apt-get install build-essential patch ruby-dev zlib1g-dev liblzma-dev

After you've run that try again and it should work perfectly! I got these instructions from their website. It may be worthwhile to add this to the readme for any other Ubuntu users 😄

@viper25
Copy link

viper25 commented Feb 3, 2019

I too tried to setup Jekyll on a fresh Ubuntu system. Installed all the below packages

sudo apt-get install build-essential patch ruby-dev zlib1g-dev liblzma-dev make 

then did

echo '# Install Ruby Gems to ~/gems' >> ~/.bashrc
echo 'export GEM_HOME="$HOME/gems"' >> ~/.bashrc
echo 'export PATH="$HOME/gems/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc

gem install jekyll bundler

No issues till the above. I then clone your repo and follow instructions and I get this:

ubuntu@ubuntu:~/resume-template$ bundle install
Traceback (most recent call last):
	2: from /home/ubuntu/gems/bin/bundle:23:in `<main>'
	1: from /usr/lib/ruby/2.5.0/rubygems.rb:308:in `activate_bin_path'
/usr/lib/ruby/2.5.0/rubygems.rb:289:in `find_spec_for_exe': can't find gem bundler (>= 0.a) with executable bundle (Gem::GemNotFoundException)

Tried this many times on NEW Ubuntu installation (Live CD though)

ubuntu@ubuntu:~/resume-template$ uname -a
Linux ubuntu 4.18.0-10-generic #11-Ubuntu SMP Thu Oct 11 15:13:55 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

@HerrickSpencer
Copy link

HerrickSpencer commented Mar 3, 2019

[Windows 10, but same errors]
In my case, it was due to having the wrong version of bundler installed (>2.0) so (after consulting forums) figured out that installing the older version will work with this repo:
gem install bundler -v 1.16.1
This fixed it for me.

@viper25
Copy link

viper25 commented Apr 8, 2019

I tried with 1.16.1 too, but get errors (this is on a VM):

user@machine1-VirtualBox:~/resume$ bundle install
Fetching gem metadata from https://rubygems.org/...........
Fetching RedCloth 4.2.9
Installing RedCloth 4.2.9 with native extensions
Fetching i18n 0.7.0
Installing i18n 0.7.0
Fetching json 1.8.2
Installing json 1.8.2 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory: /home/user/gems/gems/json-1.8.2/ext/json/ext/generator
/usr/bin/ruby2.5 -r ./siteconf20190408-32480-1gyauz2.rb extconf.rb
creating Makefile

current directory: /home/user/gems/gems/json-1.8.2/ext/json/ext/generator
make "DESTDIR=" clean

current directory: /home/user/gems/gems/json-1.8.2/ext/json/ext/generator
make "DESTDIR="
compiling generator.c
generator.c: In function ‘generate_json’:
generator.c:867:25: error: ‘rb_cFixnum’ undeclared (first use in this function);
did you mean ‘mFixnum’?
     } else if (klass == rb_cFixnum) {
                         ^~~~~~~~~~
                         mFixnum
generator.c:867:25: note: each undeclared identifier is reported only once for
each function it appears in
generator.c:869:25: error: ‘rb_cBignum’ undeclared (first use in this function);
did you mean ‘mBignum’?
     } else if (klass == rb_cBignum) {
                         ^~~~~~~~~~
                         mBignum
make: *** [Makefile:243: generator.o] Error 1

make failed, exit code 2

Gem files will remain installed in /home/user/gems/gems/json-1.8.2 for
inspection.
Results logged to
/home/user/gems/extensions/x86_64-linux/2.5.0/json-1.8.2/gem_make.out

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

In Gemfile:
  github-pages was resolved to 33, which depends on
    jekyll-mentions was resolved to 0.2.1, which depends on
      html-pipeline was resolved to 1.9.0, which depends on
        activesupport was resolved to 4.2.1, which depends on
          json
user@machine1-VirtualBox:~/resume$ 

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

No branches or pull requests

5 participants