安装 Nokogiri 时 GCC 编译错误

Den*_*vic 10 ruby rubygems

我正在尝试运行,bundle install但在尝试安装 Nokogiri 1.10.3 时出现错误

这是来自 的错误消息mkmf.log

gcc -o conftest -I/home/chille/.rvm/rubies/ruby-2.5.1/include/ruby-2.5.0/x86_64-linux -I/home/chille/.rvm/rubies/ruby-2.5.1/include/ruby-2$
gcc: error: unrecognized command line option '-Wmisleading-indentation'
gcc: error: unrecognized command line option '-Wimplicit-fallthrough=0'
gcc: error: unrecognized command line option '-Wduplicated-cond'
gcc: error: unrecognized command line option '-Wrestrict'
Run Code Online (Sandbox Code Playgroud)

mAr*_*5MB 24

对于那些不看评论的人

Debian 10 用户,如果您发现

 gcc: error: unrecognized command line option '-Wduplicated-cond'
Run Code Online (Sandbox Code Playgroud)

在 mkmf.log 中

brew unlink gcc
Run Code Online (Sandbox Code Playgroud)

就是你要找的。我花了一个小时寻找答案,是的,我曾经在这里错过了答案,但幸运的是我已经回来并发现了它。