Bug #464
Error Installing Nokogiri Using Bundler on FreeBSD
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.
- Resulted in:
- 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