Project

General

Profile

Bug #464

Error Installing Nokogiri Using Bundler on FreeBSD

Added by Daniel Curtis about 6 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
High
Assignee:
Category:
Ruby
Target version:
Start date:
09/24/2014
Due date:
% Done:

90%

Estimated time:
0.20 h
Spent time:

Description

I encountered a problem while adding plugins to one redmine while running bundle install.

  • Try to install plugins for redmine:
    cd /usr/local/www/redmine
    bundle install --path vendor/bundle
    
    • Resulted in:
      Building nokogiri using packaged libraries.
      
      Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
      
              /usr/local/bin/ruby19 extconf.rb 
      Building nokogiri using packaged libraries.
      -----
      libiconv 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=/usr/local/bin/ruby19
          --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
      
      Gem files will remain installed in /usr/local/www/redmine/vendor/bundle/ruby/1.9/gems/nokogiri-1.6.3.1 for inspection.
      Results logged to /usr/local/www/redmine/vendor/bundle/ruby/1.9/gems/nokogiri-1.6.3.1/ext/nokogiri/gem_make.out
      An error occurred while installing nokogiri (1.6.3.1), and Bundler cannot
      continue.
      Make sure that `gem install nokogiri -v '1.6.3.1'` succeeds before bundling.
      
  • And when I went to install the gem directly, I received the above error. A similar problem was reported on StackOverflow on OSX, and the solution was to use the system libraries for building the nokogiri gem:
    gem install -v '1.6.3.1' -- --use-system-libraries
    

That allowed the gem to be installed, however it did not fix the problem happening with bundler.

  • Another member on StackOverflow mentioned altering the bundler config:
    bundle config build.nokogiri "--use-system-libraries" 
    

And that did the trick!

NOTE: I needed to be root in order to install using the system libraries.

  • Bundle install works again:
    bundle install --path vendor/bundle
    

Resources

History

#1 Updated by Daniel Curtis about 6 years ago

  • Description updated (diff)
  • Status changed from New to Resolved
  • % Done changed from 10 to 90

#2 Updated by Daniel Curtis about 6 years ago

  • Status changed from Resolved to Closed

#3 Updated by Daniel Curtis almost 6 years ago

  • Description updated (diff)

#4 Updated by Daniel Curtis over 5 years ago

  • Subject changed from Error Installing Nokogiri Using Bundler on FreeBSD 9.2-RELEASE to Error Installing Nokogiri Using Bundler on FreeBSD
  • Target version set to FreeBSD 9

#5 Updated by Daniel Curtis over 5 years ago

  • Category set to Ruby

Also available in: Atom PDF