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:
  • 360 Vote(s) - 3.56 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Why does installing Nokogiri on Mac OS fail with libiconv is missing?

#11
I tried many things but nothing worked for me. Then I finally found the [iconv documentation][1] and it saved my day!

[1]:

[To see links please register here]

Reply

#12
You need to upgrade your homebrew to 0.9

then follow these steps

brew install libxml2 libxslt
brew link libxml2 libxslt
wget

[To see links please register here]

tar xvfz libiconv-1.13.1.tar.gz
cd libiconv-1.13.1
./configure --prefix=/usr/local/Cellar/libiconv/1.13.1
make
sudo make install

sudo ln -s /usr/bin/gcc /usr/bin/gcc-4.2

gem install nokogiri -- --with-xml2-include=/usr/local/Cellar/libxml2/2.9.0/include/libxml2 --with-xml2-lib=/usr/local/Cellar/libxml2/2.9.0/lib --with-xslt-dir=/usr/local/Cellar/libxslt/1.1.28 --with-iconv-include=/usr/local/Cellar/libiconv/1.13.1/include --with-iconv-lib=/usr/local/Cellar/libiconv/1.13.1/lib

You should double check the folder library version.
Reply

#13
This [blog post](

[To see links please register here]

) proposes to install libiconv manually.

Subsequently, nokogiri can be installed with a number of switches telling it where to find libiconv (see the blog post).

As a side note: After installing nokogiri, I managed to install gollum (installation of which also failed because it could not find iconv). Now I am still facing problems though, because when I start up gollum, Python crashes.
Reply

#14
$ gem install iconv # works but it is missing an iconv.so file in ruby 2.0.0-p247

$ ls -1 2.0.0-p0/lib/ruby/gems/2.0.0/gems/iconv-1.0.3/*/*/*.so
2.0.0-p0/lib/ruby/gems/2.0.0/gems/iconv-1.0.3/ext/iconv/iconv.so*
2.0.0-p0/lib/ruby/gems/2.0.0/gems/iconv-1.0.3/lib/iconv/iconv.so*

$ ls -1 2.0.0-p247/lib/ruby/gems/2.0.0/gems/iconv-1.0.3/*/*/*.so
2.0.0-p247/lib/ruby/gems/2.0.0/gems/iconv-1.0.3/ext/iconv/iconv.so*

# NOTE THE MISSING /lib/iconv/iconv.so file in 2.0.0-p247 that is present in 2.0.0-p0 gems installation.

$ rbenv version
2.0.0-p247 (set by /home/XXX/tmp/.ruby-version)
$ rbenv which gem
/home/XXX/.rbenv/versions/2.0.0-p247/bin/gem
$ gem --version
1.8.25

$ rbenv which pry
/home/XXX/.rbenv/versions/2.0.0-p247/bin/pry
$ pry
[1] pry(main)> require 'iconv'
LoadError: cannot load such file -- iconv/iconv.so
from /home/XXX/.rbenv/versions/2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/custom_require.rb:36:in `require'

# Copy the file over

$ pushd ~/.rbenv/versions/
$ cp 2.0.0-p247/lib/ruby/gems/2.0.0/gems/iconv-1.0.3/ext/iconv/iconv.so 2.0.0-p247/lib/ruby/gems/2.0.0/gems/iconv-1.0.3/lib/iconv/

# NOW IT WORKS!

$ pry
[1] pry(main)> require 'iconv'
=> true
Reply

#15
I had to install gcc first before running `./configure --prefix=/usr/local/Cellar/libiconv/1.13.1`
Reply

#16
I followed instructions from nokogiri installation page and also installed xcode tools. But it still did not work for me.

Then I saw that `brew install libxml2 libxslt` command outputs the following (among other different stuff):

To allow the nokogiri gem to link against this libxslt run:
gem install nokogiri -- --with-xslt-dir=/usr/local/opt/libxslt

So, I run this and nokogiri was installed succesfully.
Reply

#17
I ran into this, this morning... after an upgrade to Mavericks. We did many things. However if anyone is having this issue here are some things to try.

I ran 'xcode-select --install' then got the command line tools installed (surprised this didn't update on the OS ugrade).
I ran 'rvm implode' (I will build it back up later).

We pieced together two error output files:

~/.vagrant.d/gems/gems/nokogiri-1.6.3.1/ext/nokogiri/gem_make.out

~/.vagrant.d/gems/gems/nokogiri-1.6.3.1/ext/nokogiri/tmp/x86_64-apple-darwin12.5.0/ports/libxml2/2.8.0/configure.log

Which seemed to indicate that the c compiler was using a surprising setting.

I ran 'env'

Output contained:

...
CXX=/usr/local/opt/apple-gcc42/bin/g++-4.2
...
CC=/usr/local/opt/apple-gcc42/bin/gcc-4.2
...

These files didn't exist on the file system...

After all of these changes moving to a new terminal windows (so everything was fresh). Installation of vagrant-berkshelf (which in turn installs nokogiri) worked fine.

NOTE: when running 'env' in the fresh window there was no longer a setting for CC or CXX...

Unsure on the key part of this, or if order matters, but tried to recreate the parts that seemed to play a role in getting this to work.
Reply

#18
This works for me:



gem install nokogiri -- --use-system-libraries

If you are using Bundler, tell it to use the option:

bundle config build.nokogiri --use-system-libraries
bundle install

[ref][1]


[1]:

[To see links please register here]

Reply

#19
You could also do this on Mavericks:

gem install nokogiri -- --use-system-libraries=true --with-xml2-include=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/libxml2

Just make sure you have xcode installed
Reply

#20
- As a self-contained solution, I've put together [this ruby script as a gist]() that should work with any recent Mac OS X / Homebrew installation.
- You're basically just on on relying Homebrew's libraries instead of the outdated Apple ones. Simple.
- You can configure and install with Bundler (instead of `gem`) by passing `bundle` as an argument.

Check it out, and please feel free to contribute--maybe we can boil this down to one script to fix them all!
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

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