问题
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