Nokogiri gem installation issues on Mac OSx with Ruby 2.1.5

On our Mac OSx, if we upgrade to latest Ruby 2.1.5 (or even 2.1.2) then there are high chances that we will face issues installing nokogiri gem. We might face errors like: ERROR: Failed to build gem native extension. Following are the steps to resolve these issues on Mac OSx Install library libxml2 using brew. brew install libxml2 Read complete error dump on console while doing bundle or bundle install. We will notice that there are useful tips to fix this on our OS, for example for building Nokogiri with a packaged version of libxml2-2.9.