gem install nokogiri -v'1.5.11'因make而失败:/ usr / local / bin / gmkdir:没有这样的文件或目录

时间:2023-01-05 00:15:01

Ruby version: 2.2.5

Ruby版本:2.2.5

Mac OSX: 10.11.5

Mac OSX:10.11.5

Gem version: 2.4.8

宝石版:2.4.8

Bundler version: 1.12.5

Bundler版本:1.12.5

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

当我运行gem install nokogiri -v'1.5.11'时,我收到以下错误:

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

2 个解决方案

#1


11  

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

我注意到错误消息说:make:/ usr / local / bin / gmkdir:没有这样的文件或目录。

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

我在谷歌搜索过这个帖子,发现了一个类似的帖子,但对于cocopods:https://coderwall.com/p/ehijxg/fixing-error-installing-cocoapods-on-macos

But I didn't use sudo, only brew install coreutils is enough.

但我没有使用sudo,只有brew install coreutils就足够了。

So the following commands solved my problem:

所以以下命令解决了我的问题:

brew install coreutils
gem install nokogiri -v '1.5.11'

If you have different reasons, please refer to: http://www.nokogiri.org/tutorials/installing_nokogiri.html

如果您有不同的原因,请参阅:http://www.nokogiri.org/tutorials/installing_nokogiri.html

#2


1  

I had this problem last time and you can try this code:

我上次遇到这个问题你可以尝试这个代码:

gem install nokogiri -v 1.5.11 -- --use-system-libraries

I think it will work.

我认为它会起作用。

#1


11  

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

我注意到错误消息说:make:/ usr / local / bin / gmkdir:没有这样的文件或目录。

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

我在谷歌搜索过这个帖子,发现了一个类似的帖子,但对于cocopods:https://coderwall.com/p/ehijxg/fixing-error-installing-cocoapods-on-macos

But I didn't use sudo, only brew install coreutils is enough.

但我没有使用sudo,只有brew install coreutils就足够了。

So the following commands solved my problem:

所以以下命令解决了我的问题:

brew install coreutils
gem install nokogiri -v '1.5.11'

If you have different reasons, please refer to: http://www.nokogiri.org/tutorials/installing_nokogiri.html

如果您有不同的原因,请参阅:http://www.nokogiri.org/tutorials/installing_nokogiri.html

#2


1  

I had this problem last time and you can try this code:

我上次遇到这个问题你可以尝试这个代码:

gem install nokogiri -v 1.5.11 -- --use-system-libraries

I think it will work.

我认为它会起作用。