Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 336 Vote(s) - 3.51 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Failing to install Nokogiri gem

#1
I'm working on a rails app that allows for image attachments to each use account. I'm using paperclip and amazon web services:

gem 'paperclip'
gem 'aws-sdk'

When I run bundle install, I get this message:

extconf failed, exit code 1

Gem files will remain installed in /usr/local/rvm/gems/ruby-2.1.2/gems/nokogiri-1.6.5 for inspection.
Results logged to /usr/local/rvm/gems/ruby-2.1.2/extensions/x86_64-darwin-13/2.1.0-static/nokogiri-1.6.5/gem_make.out
An error occurred while installing nokogiri (1.6.5), and Bundler cannot continue.
Make sure that `gem install nokogiri -v '1.6.5'` succeeds before bundling.

When I try running 'gem install nokogiri', I get this message:

extconf failed, exit code 1

Gem files will remain installed in /usr/local/rvm/gems/ruby-2.1.2/gems/nokogiri-1.6.5 for inspection.
Results logged to /usr/local/rvm/gems/ruby-2.1.2/extensions/x86_64-darwin-13/2.1.0-static/nokogiri-1.6.5/gem_make.out


My OS is Mac OS X 10.9.4 Mavericks. **What's going on here? How can I get nokogiri to install and behave properly?**

**Full stack trace**:

Building native extensions with: '--use-system-libraries'
This could take a while...
ERROR: Error installing nokogiri:
ERROR: Failed to build gem native extension.

/usr/local/rvm/rubies/ruby-2.1.2/bin/ruby extconf.rb --use-system-libraries
checking if the C compiler accepts ... yes
checking if the C compiler accepts -Wno-error=unused-command-line-argument-hard-error-in-future... yes
Building nokogiri using system libraries.
libxml2 version 2.6.21 or later is required!
*** 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/local/rvm/rubies/ruby-2.1.2/bin/ruby
--help
--clean
--use-system-libraries
--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-xml2-dir
--without-xml2-dir
--with-xml2-include
--without-xml2-include=${xml2-dir}/include
--with-xml2-lib
--without-xml2-lib=${xml2-dir}/lib
--with-libxml-2.0-config
--without-libxml-2.0-config
--with-pkg-config
--without-pkg-config
--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-exslt-dir
--without-exslt-dir
--with-exslt-include
--without-exslt-include=${exslt-dir}/include
--with-exslt-lib
--without-exslt-lib=${exslt-dir}/lib
--with-libexslt-config
--without-libexslt-config

extconf failed, exit code 1

Gem files will remain installed in /usr/local/rvm/gems/ruby-2.1.2/gems/nokogiri-1.6.5 for inspection.
Results logged to /usr/local/rvm/gems/ruby-2.1.2/extensions/x86_64-darwin-13/2.1.0-static/nokogiri-1.6.5/gem_make.out

Reply

#2
> I had the same issue earlier today. I had updated my xcode and had not
> agreed to the terms yet. Running sudo `xcodebuild -license` and agreeing
> got my bundle working again.

-

[To see links please register here]

Reply

#3
As per the nokogiri installation instruction installing,

`sudo apt-get install zlib1g-dev`

solved the issue for me.
Reply

#4
To take from [dylanjhunt's awesome answer on Github][1], just in case anyone hasn't tried it,

> Just to add to this, I was having a very similar issue that was
> resolved by updating dev tools.
>
> `xcode-select --install`
>
> Hoping someone sees this that had not tried doing this yet and it
> helps.

[1]:

[To see links please register here]

Reply

#5
On Ubuntu, try installing the following dependencies:

sudo apt-get install gcc ruby-dev libxslt-dev libxml2-dev zlib1g-dev
Reply

#6
I solved this by installing the xcode dependencies that Nokogiri needs to be installed:

xcode-select --install

After that run bundle install again and it should work.
Reply

#7
install gcc first

in *buntu :
apt-get install gcc

after that U may requer most dev libs, such as
libxml2 / zlib / etc.
see build log(path in my case) :
/var/lib/gems/2.3.0/extensions/x86_64-linux/2.3.0/nokogiri-1.6.8.1/mkmf.log
for string like - fatal error: zlib.h: No such file or directory
Reply

#8
I didn't get the same error message as you, but I wanted to note what I finally found as the **extraordinarily simple solution** for installing nokogiri on Ubuntu:

**Turns out the nokogiri build process depends on `patch`.**

**Run: `sudo apt-get install patch`**

I was working on a VM (a vagrant box, actually), which is why I didn't already have `patch` installed.

The error I got (after a lot of other stuff that looked like an error but was actually just a warning) was:

Extracting libxml2-2.9.2.tar.gz into tmp/x86_64-pc-linux-gnu/ports/libxml2/2.9.2... OK
Running patch with /var/lib/gems/1.9.1/gems/nokogiri-1.6.6.2/ports/patches/libxml2/0001-Revert-Missing-initialization-for-the-catalog-module.patch...
Running 'patch' for libxml2 2.9.2... ERROR, review '/var/lib/gems/1.9.1/gems/nokogiri-1.6.6.2/ext/nokogiri/tmp/x86_64-pc-linux-gnu/ports/libxml2/2.9.2/patch.log' to see what happened.

I've deleted the log by now (the above was in my terminal session), but the `patch.log` file referenced above was absurdly simple; it just said something like `patch not found`.

Boy did I feel silly for all the digging around I did installing libraries trying to fix it! :)
Reply

#9
after upgrading to Rails 4.2.4 (which inculdes Nokogiri `1.6.6.2`) on Ubuntu 14.04 (I'm using RVM) I needed to do this:

sudo apt-get install libgmp-dev


or


sudo apt-get install libgmp3-dev
Reply

#10
Package that did it:

apt-get install libghc-zlib-dev

Other possible candidate:

`zlib1g-dev` on 12.04

found it [here][1]


[1]:

[To see links please register here]

Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through