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-
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
On Ubuntu, try installing the following dependencies:
sudo apt-get install gcc ruby-dev libxslt-dev libxml2-dev zlib1g-dev
Since the OP was referencing bundle install
which I happened to use as well I think it is worth pointing out the Installing Nokogiri page which eventually revealed the most elegant solution (which worked for me also on Mac OS X 10.8.5):
bundle config build.nokogiri --use-system-libraries
bundle install
This instructs bundler to install nokogiri as in the answers of @kasperite
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.
As per the nokogiri installation instruction installing,
sudo apt-get install zlib1g-dev
solved the issue for me.
This works like a charm!
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
https://stackoverflow.com/a/24511149