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 during bundle install #25

Closed
paulioceano opened this issue Aug 28, 2018 · 4 comments
Closed

Error during bundle install #25

paulioceano opened this issue Aug 28, 2018 · 4 comments
Assignees

Comments

@paulioceano
Copy link
Contributor

The bundle install run throws an error regarding the Ruby version required for the gem Nokogiri.

Even when the ruby version installed is 2.4.4, still request for version 2.4.*-

Apparently, there is a version issue with that gem (sparklemotion/nokogiri#1618).

According to this, the issue was solved with Nokogiri version 1.8.0

@albertoperdomo
Copy link

Hello @paulioceano,

is this when running bundle install directly on windows?
Can you paste the relevant section of the output here?

I tried updating Nokogiri dependency to 1.8.0 but that doesn't seem to work, as Rails depends on Nokogiri 1.6.x.

I could try using a version that is >= 1.6.0 and < 1.6.8, but I don't know if you would still get an issue on Windows. Can you try that out yourself, by following these steps?

  1. Add this line to Gemfile: `gem 'nokogiri', '= 1.6.0'``
  2. Run bundle update nokogiri

Also, can you please try this out on Ruby 2.5?

@paulioceano
Copy link
Contributor Author

paulioceano commented Aug 29, 2018

Hi @albertoperdomo .

Yes, this error happens when running ´bundle install´ directtly on windows.
This is the output:

Fetching nokogiri 1.6.8 (x64-mingw32)
Installing nokogiri 1.6.8 (x64-mingw32)
Gem::InstallError: nokogiri requires Ruby version < 2.4, >= 1.9.2.
An error occurred while installing nokogiri (1.6.8), and Bundler cannot
continue.
Make sure that `gem install nokogiri -v '1.6.8'` succeeds before bundling.

In Gemfile:
  rails was resolved to 5.0.0.1, which depends on
    actioncable was resolved to 5.0.0.1, which depends on
      actionpack was resolved to 5.0.0.1, which depends on
        actionview was resolved to 5.0.0.1, which depends on
          rails-dom-testing was resolved to 2.0.1, which depends on
            nokogiri

After adding the line gem 'nokogiri', '= 1.6.0' to the Gemfile got this error:

Fetching nokogiri 1.6.0 (was 1.6.8)
Installing nokogiri 1.6.0 (was 1.6.8) with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory:
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/nokogiri-1.6.0/ext/nokogiri
C:/Ruby24-x64/bin/ruby.exe -r ./siteconf20180828-5384-xssqk0.rb extconf.rb
checking for libxml/parser.h... no
-----
libxml2 is missing.  please visit
http://nokogiri.org/tutorials/installing_nokogiri.html for help with installing
dependencies.
-----
*** 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=C:/Ruby24-x64/bin/$(RUBY_BASE_NAME)
        --with-zlib-dir
        --without-zlib-dir
        --with-zlib-include
        --without-zlib-include=${zlib-dir}/include
        --with-zlib-lib
        --without-zlib-lib=${zlib-dir}/lib
        --with-iconv-dir
        --without-iconv-dir
        --with-iconv-include
        --without-iconv-include=${iconv-dir}/include
        --with-iconv-lib
        --without-iconv-lib=${iconv-dir}/lib
        --with-xml2-dir
        --without-xml2-dir
        --with-xml2-include
        --without-xml2-include=${xml2-dir}/include
        --with-xml2-lib
        --without-xml2-lib=${xml2-dir}/lib
        --with-xslt-dir
        --without-xslt-dir
        --with-xslt-include
        --without-xslt-include=${xslt-dir}/include
        --with-xslt-lib
        --without-xslt-lib=${xslt-dir}/lib
        --with-libxslt-config
        --without-libxslt-config
        --with-pkg-config
        --without-pkg-config
        --with-libxml-2.0-config
        --without-libxml-2.0-config
        --with-libiconv-config
        --without-libiconv-config

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

be found here:

C:/Ruby24-x64/lib/ruby/gems/2.4.0/extensions/x64-mingw32/2.4.0/nokogiri-1.6.0/mk
mf.log

extconf failed, exit code 1

Gem files will remain installed in
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/nokogiri-1.6.0 for inspection.
Results logged to
C:/Ruby24-x64/lib/ruby/gems/2.4.0/extensions/x64-mingw32/2.4.0/nokogiri-1.6.0/ge
m_make.out

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

In Gemfile:
  rails was resolved to 5.0.0.1, which depends on
    actioncable was resolved to 5.0.0.1, which depends on
      actionpack was resolved to 5.0.0.1, which depends on
        actionview was resolved to 5.0.0.1, which depends on
          rails-dom-testing was resolved to 2.0.1, which depends on
            nokogiri

@albertoperdomo
Copy link

Hello @paulioceano,

libxml2 is missing. please visit
http://nokogiri.org/tutorials/installing_nokogiri.html for help with installing

Can you please open the URL in the output and follow the instructions (or some other tutorial) to install nokogiri? Then try again with that line gem 'nokogiri', '= 1.6.0'?

@jimmyjames
Copy link
Contributor

Closing this issue given the suggestion from @albertoperdomo. If you continue to experience this issue please reopen or create a new issue.

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

3 participants