使用捆绑安装时发生错误:nokogiri安装错误

问题描述

我正在使用ubuntu,当我使用捆绑安装时,安装nokogiri时出现错误。我该如何解决

gem_make.out:

At top level:
xslt_stylesheet.c:112:13: warning: ‘swallow_superfluous_xml_errors’ defined but not used [-Wunused-function]
  112 | static void swallow_superfluous_xml_errors(void * userdata,xmlErrorPtr error,...)
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: warning: unrecognized command line option ‘-Wno-self-assign’
cc1: warning: unrecognized command line option ‘-Wno-parentheses-equality’
cc1: warning: unrecognized command line option ‘-Wno-constant-logical-operand’
linking shared-object nokogiri/nokogiri.so
Cleaning files only used during build.
rm -rf /home/domke89/.rvm/gems/ruby-2.7.0/gems/nokogiri-1.10.10/ports/archives

current directory: /home/domke89/.rvm/gems/ruby-2.7.0/gems/nokogiri-1.10.10/ext/nokogiri
make "DESTDIR=" install
make: /usr/bin/mkdir: Command not found
make: *** [Makefile:202: .sitearchdir.-.nokogiri.time] Error 127

make install Failed,exit code 2

解决方法

似乎在this issue的Nokogiri Github上也处理了类似的问题。

从讨论中看来,您的机器上的Ruby和Rubygems配置似乎有一些问题。