Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gem install nokogiri -v '1.5.11' failed due to make: /usr/local/bin/gmkdir: No such file or directory

Ruby version: 2.2.5

Mac OSX: 10.11.5

Gem version: 2.4.8

Bundler version: 1.12.5

When I run gem install nokogiri -v '1.5.11', I got the following error:

Building native extensions. This could take a while...
ERROR:  Error installing nokogiri:
ERROR: Failed to build gem native extension.

/Users/hwpeng/.rvm/rubies/ruby-2.2.5/bin/ruby -r ./siteconf20160707-31800-1ejznjc.rb extconf.rb

====ignored multiple lines====

make "DESTDIR=" install
make: /usr/local/bin/gmkdir: No such file or directory
make: *** [.RUBYARCHDIR.-.nokogiri.time] Error 1

make install failed, exit code 2
like image 649
Max Peng Avatar asked Jul 07 '16 09:07

Max Peng


1 Answers

I noticed the error message said: make: /usr/local/bin/gmkdir: No such file or directory.

I searched this in google and found a similar post but for cocopods: https://coderwall.com/p/ehijxg/fixing-error-installing-cocoapods-on-macos

The following commands solved my problem. If you have a different error message, please refer to http://www.nokogiri.org/tutorials/installing_nokogiri.html

Homebrew

brew install coreutils
gem install nokogiri -v '1.5.11'

MacPorts

sudo port install coreutils
gem install nokogiri -v '1.5.11'
like image 192
Max Peng Avatar answered Oct 04 '22 04:10

Max Peng