GCC compilation error when installing Nokogiri

放肆的年华 提交于 2021-02-18 21:58:44

问题


I'm trying to run bundle install but I'm getting the Error while trying to Install Nokogiri 1.10.3

Here is the error message from 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'

回答1:


For those who do not read comments

Debian 10 users, if you find

 gcc: error: unrecognized command line option '-Wduplicated-cond'

in mkmf.log

brew unlink gcc

is what you are looking for. I spend an hour looking for an answer and yes, i once missed the answer here, but luckily i have returned and spotted it.




回答2:


I had faced a similar issue. My default compiler did not recognise certain command line options just like you are facing.

My gcc version was 10. I could solve it by adding an older gcc version (5.5) and set it as default for the gem installation purpose. I followed the step given in this thread to do so.



来源:https://stackoverflow.com/questions/56567095/gcc-compilation-error-when-installing-nokogiri

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!