4

Due to Mavericks having some issues with selecting the right C-compiler sometimes when running bundle install I have to install some of my gems with special flags.

One example of this is I have to run: gem install nokogiri -- --use-system-libraries. This is further discussed here: Error to install Nokogiri on OSX 10.9 Maverick?

So my question is: Is there a way to tell bundler to use system libraries when installing nokogiri? Or is there a way to tell gem install that it should install as "deployment"-gem.

Any other suggestions as how to solve this problem or why I'm having it would be very welcome.

Community
  • 1
  • 1
Albin
  • 2,912
  • 1
  • 21
  • 31

2 Answers2

7

You can tell bundler about flags to use when installing gems with

bundle config build.nokogiri --with-system-libraries

This sets this as a global default, ie this setting is stored in ~/.bundle/config. To store it for the current project only, run

bundle config --local build.nokogiri --with-system-libraries
Frederick Cheung
  • 83,189
  • 8
  • 152
  • 174
  • This did not work when running bundle with `--deployment` flag. I solved it using `NOKOGIRI_USE_SYSTEM_LIBRARIES=1 bundle install --deployment`. Thank you for the help with editing my question. It helped me google the problem more efficiently – Albin Jan 07 '15 at 21:36
0

Solved it by

NOKOGIRI_USE_SYSTEM_LIBRARIES=1 bundle install --deployment

Albin
  • 2,912
  • 1
  • 21
  • 31