Nokogiri: Can't write /usr/bin/nokogiri while Installing on Mac OS EI Capitan

Created on 9 Nov 2015  路  2Comments  路  Source: sparklemotion/nokogiri

Here is the console log:

buildServicedeMac-mini:usr buildservice$ sudo  gem install nokogiri  -- --use-system-libraries --with-xml2-include=/usr/include/libxml2 --with-xml2-lib=/usr/lib
Building native extensions with: '--use-system-libraries --with-xml2-include=/usr/include/libxml2 --with-xml2-lib=/usr/lib'
This could take a while...
ERROR:  While executing gem ... (Errno::EPERM)
    Operation not permitted - /usr/bin/nokogiri

Mac OS EI Capitan has disable the permission of creating file in /usr/bin directory, even 'sudo' a writing command. Is nokogiri going to fix this ?

Most helpful comment

Solution:
sudo gem install nokogiri -n /usr/local/bin

(El Capitan ships with additional protection: SIP)

All 2 comments

Thanks for asking this question, and I'm sorry you're having problems.

This is not a nokogiri question, but rather a question of how your system is configured and whether you need to run 'sudo' when you gem install.

I encourage you to ask for help on a more general Ruby list or forum.

Solution:
sudo gem install nokogiri -n /usr/local/bin

(El Capitan ships with additional protection: SIP)

Was this page helpful?
0 / 5 - 0 ratings