Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation difficulties with gcc link #2035

Closed
kiranparajuli589 opened this issue May 27, 2020 · 7 comments
Closed

Installation difficulties with gcc link #2035

kiranparajuli589 opened this issue May 27, 2020 · 7 comments

Comments

@kiranparajuli589
Copy link

Have you read and followed the installation tutorial at http://www.nokogiri.org/tutorials/installing_nokogiri.html?
Yes

What is the complete output of gem install?

Building native extensions. This could take a while...
ERROR:  Error installing nokogiri:
	ERROR: Failed to build gem native extension.

    current directory: /home/kiran/.rvm/gems/ruby-2.7.1/gems/nokogiri-1.10.9/ext/nokogiri
/home/kiran/.rvm/rubies/ruby-2.7.1/bin/ruby -I /home/kiran/.rvm/rubies/ruby-2.7.1/lib/ruby/site_ruby/2.7.0 -r ./siteconf20200527-72710-1hdpmvn.rb extconf.rb
checking if the C compiler accepts ... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
	--with-opt-dir
	--without-opt-dir
	--with-opt-include
	--without-opt-include=${opt-dir}/include
	--with-opt-lib
	--without-opt-lib=${opt-dir}/lib
	--with-make-prog
	--without-make-prog
	--srcdir=.
	--curdir
	--ruby=/home/kiran/.rvm/rubies/ruby-2.7.1/bin/$(RUBY_BASE_NAME)
	--help
	--clean
/home/kiran/.rvm/rubies/ruby-2.7.1/lib/ruby/2.7.0/mkmf.rb:471:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
	from /home/kiran/.rvm/rubies/ruby-2.7.1/lib/ruby/2.7.0/mkmf.rb:597:in `block in try_compile'
	from /home/kiran/.rvm/rubies/ruby-2.7.1/lib/ruby/2.7.0/mkmf.rb:544:in `with_werror'
	from /home/kiran/.rvm/rubies/ruby-2.7.1/lib/ruby/2.7.0/mkmf.rb:597:in `try_compile'
	from extconf.rb:138:in `nokogiri_try_compile'
	from extconf.rb:162:in `block in add_cflags'
	from /home/kiran/.rvm/rubies/ruby-2.7.1/lib/ruby/2.7.0/mkmf.rb:655:in `with_cflags'
	from extconf.rb:161:in `add_cflags'
	from extconf.rb:416:in `<main>'

To see why this extension failed to compile, please check the mkmf.log which can be found here:



extconf failed, exit code 1

Gem files will remain installed in /home/kiran/.rvm/gems/ruby-2.7.1/gems/nokogiri-1.10.9 for inspection.
Results logged to /home/kiran/.rvm/gems/ruby-2.7.1/extensions/x86_64-linux/2.7.0/nokogiri-1.10.9/gem_make.out

What are the complete contents of the mkmf.log file generated during the failed installation?

"gcc -o conftest -I/home/kiran/.rvm/rubies/ruby-2.7.1/include/ruby-2.7.0/x86_64-linux -I/home/kiran/.rvm/rubies/ruby-2.7.1/include/ruby-2.7.0/ruby/backward -I/home/kiran/.rvm/rubies/ruby-2.7.1/include/ruby-2.7.0 -I.    -O3 -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wduplicated-cond -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wwrite-strings -Wimplicit-fallthrough=0 -Wmissing-noreturn -Wno-cast-function-type -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-packed-bitfield-compat -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wsuggest-attribute=format -Wsuggest-attribute=noreturn -Wunused-variable  -fPIC  conftest.c  -L. -L/home/kiran/.rvm/rubies/ruby-2.7.1/lib -Wl,-rpath,/home/kiran/.rvm/rubies/ruby-2.7.1/lib -L. -fstack-protector-strong -rdynamic -Wl,-export-dynamic     -Wl,-rpath,'/../lib' -Wl,-rpath,'/../lib' -lruby  -lm   -lc "
gcc: error: unrecognized command line option '-Wduplicated-cond'
gcc: error: unrecognized command line option '-Wmisleading-indentation'
gcc: error: unrecognized command line option '-Wimplicit-fallthrough=0'
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: int main(int argc, char **argv)
4: {
5:   return !!argv[argc];
6: }
/* end */

What operating system are you using?
Linux kiran-OptiPlex-3050 5.4.0-31-generic #35-Ubuntu SMP Thu May 7 20:20:34 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=20.04
DISTRIB_CODENAME=focal
DISTRIB_DESCRIPTION="Ubuntu 20.04 LTS"
@flavorjones
Copy link
Member

Is this a duplicate of #2034? If so, can you please close it?

@flavorjones
Copy link
Member

@kiranparajuli589 I see options being passed to gcc that it doesn't understand. This is likely because the compiler used to build/install ruby on your system is different from your current version of gcc. Can you confirm if this might be the case?

C extensions generally get built using the same compiler options as Ruby was built with -- these options are preserved in RbConfig, but can cause issues if different compiler are used.

@kiranparajuli589
Copy link
Author

kiranparajuli589 commented May 28, 2020

Is this a duplicate of #2034? If so, can you please close it?

@flavorjones I think it's the same because both errors were on my system.
If I run brew unlink gcc then the error is as in #2034 and if I do brew link gcc then the error is as stated above in this issue

@kiranparajuli589
Copy link
Author

kiranparajuli589 commented May 28, 2020

@flavorjones the output of gcc -v on my system is:

Using built-in specs.
COLLECT_GCC=gcc
OFFLOAD_TARGET_NAMES=nvptx-none:hsa
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 9.3.0-10ubuntu2' --with-bugurl=file:///usr/share/doc/gcc-9/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,gm2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-9 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none,hsa --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 9.3.0 (Ubuntu 9.3.0-10ubuntu2) 

PS: I'm running ruby through rvm

rvm 1.29.10 (latest) by Michal Papis, Piotr Kuczynski, Wayne E. Seguin [https://rvm.io]

@kiranparajuli589
Copy link
Author

kiranparajuli589 commented May 28, 2020

@kiranparajuli589 I see options being passed to gcc that it doesn't understand. This is likely because the compiler used to build/install ruby on your system is different from your current version of gcc. Can you confirm if this might be the case?

C extensions generally get built using the same compiler options as Ruby was built with -- these options are preserved in RbConfig, but can cause issues if different compiler are used.

@flavorjones I do not know how to confirm what you said so if you can please guide me through.

This is the output of RbConfig::CONFI inside irb if it helps:

{
    "DESTDIR"=>"", 
    "MAJOR"=>"2", 
    "MINOR"=>"7", 
    "TEENY"=>"1", 
    "PATCHLEVEL"=>"83", 
    "INSTALL"=>"/usr/bin/install", 
    "EXEEXT"=>"", 
    "prefix"=>"/home/kiran/.rvm/rubies/ruby-2.7.1", 
    "ruby_install_name"=>"ruby", 
    "RUBY_INSTALL_NAME"=>"ruby", 
    "RUBY_SO_NAME"=>"ruby", 
    "exec"=>"exec", 
    "ruby_pc"=>"ruby-2.7.pc", 
    "CC_WRAPPER"=>"", 
    "PACKAGE"=>"ruby", 
    "BUILTIN_TRANSSRCS"=>" enc/trans/newline.c", 
    "MANTYPE"=>"doc", 
    "vendorarchhdrdir"=>"/home/kiran/.rvm/rubies/ruby-2.7.1/include/ruby-2.7.0/vendor_ruby/x86_64-linux", 
    "sitearchhdrdir"=>"/home/kiran/.rvm/rubies/ruby-2.7.1/include/ruby-2.7.0/site_ruby/x86_64-linux", 
    "rubyarchhdrdir"=>"/home/kiran/.rvm/rubies/ruby-2.7.1/include/ruby-2.7.0/x86_64-linux", 
    "vendorhdrdir"=>"/home/kiran/.rvm/rubies/ruby-2.7.1/include/ruby-2.7.0/vendor_ruby", 
    "sitehdrdir"=>"/home/kiran/.rvm/rubies/ruby-2.7.1/include/ruby-2.7.0/site_ruby", 
    "rubyhdrdir"=>"/home/kiran/.rvm/rubies/ruby-2.7.1/include/ruby-2.7.0", 
    "RUBY_SEARCH_PATH"=>"", 
    "UNIVERSAL_INTS"=>"", 
    "UNIVERSAL_ARCHNAMES"=>"", 
    "configure_args"=>" '--prefix=/home/travis/.rvm/rubies/ruby-2.7.1' '--without-tcl' '--without-tk' '--without-gmp' '--enable-load-relative' '--sysconfdir=/etc' '--disable-install-doc' '--enable-shared'", 
    "CONFIGURE"=>"configure", 
    "vendorarchdir"=>"/home/kiran/.rvm/rubies/ruby-2.7.1/lib/ruby/vendor_ruby/2.7.0/x86_64-linux", 
    "vendorlibdir"=>"/home/kiran/.rvm/rubies/ruby-2.7.1/lib/ruby/vendor_ruby/2.7.0", 
    "vendordir"=>"/home/kiran/.rvm/rubies/ruby-2.7.1/lib/ruby/vendor_ruby", 
    "sitearchdir"=>"/home/kiran/.rvm/rubies/ruby-2.7.1/lib/ruby/site_ruby/2.7.0/x86_64-linux", 
    "sitelibdir"=>"/home/kiran/.rvm/rubies/ruby-2.7.1/lib/ruby/site_ruby/2.7.0", 
    "sitedir"=>"/home/kiran/.rvm/rubies/ruby-2.7.1/lib/ruby/site_ruby", 
    "rubyarchdir"=>"/home/kiran/.rvm/rubies/ruby-2.7.1/lib/ruby/2.7.0/x86_64-linux", 
    "rubylibdir"=>"/home/kiran/.rvm/rubies/ruby-2.7.1/lib/ruby/2.7.0", 
    "ruby_version"=>"2.7.0", 
    "sitearch"=>"x86_64-linux", 
    "arch"=>"x86_64-linux", 
    "sitearchincludedir"=>"/home/kiran/.rvm/rubies/ruby-2.7.1/include/x86_64-linux", 
    "archincludedir"=>"/home/kiran/.rvm/rubies/ruby-2.7.1/include/x86_64-linux", 
    "sitearchlibdir"=>"/home/kiran/.rvm/rubies/ruby-2.7.1/lib/x86_64-linux", 
    "archlibdir"=>"/home/kiran/.rvm/rubies/ruby-2.7.1/lib/x86_64-linux", 
    "libdirname"=>"libdir", 
    "RUBY_EXEC_PREFIX"=>"", "RUBY_LIB_VERSION"=>"", 
    "RUBY_LIB_VERSION_STYLE"=>"3\t/* full */", "RI_BASE_NAME"=>"ri", 
    "ridir"=>"/home/kiran/.rvm/rubies/ruby-2.7.1/share/ri", 
    "rubysitearchprefix"=>"/home/kiran/.rvm/rubies/ruby-2.7.1/lib/ruby/x86_64-linux", 
    "rubyarchprefix"=>"/home/kiran/.rvm/rubies/ruby-2.7.1/lib/ruby/x86_64-linux", 
    "MAKEFILES"=>"Makefile GNUmakefile", 
    "PLATFORM_DIR"=>"", 
    "THREAD_MODEL"=>"pthread", 
    "SYMBOL_PREFIX"=>"", 
    "EXPORT_PREFIX"=>"", 
    "COMMON_HEADERS"=>"", 
    "COMMON_MACROS"=>"", 
    "COMMON_LIBS"=>"", 
    "MAINLIBS"=>"-lz -lpthread -lrt -lrt -ldl -lcrypt -lm ", 
    "ENABLE_SHARED"=>"yes", 
    "DLDSHARED"=>"gcc -shared", 
    "DLDLIBS"=>" -lc", 
    "SOLIBS"=>"-lz -lpthread -lrt -lrt -ldl -lcrypt -lm ", 
    "LIBRUBYARG_SHARED"=>"-Wl,-rpath,'${ORIGIN}/../lib' -Wl,-rpath,'${ORIGIN}/../lib' -lruby", 
    "LIBRUBYARG_STATIC"=>"-Wl,-rpath,'${ORIGIN}/../lib' -Wl,-rpath,'${ORIGIN}/../lib' -lruby-static -lz -lpthread -lrt -lrt -ldl -lcrypt -lm ", 
    "LIBRUBYARG"=>"-Wl,-rpath,'${ORIGIN}/../lib' -Wl,-rpath,'${ORIGIN}/../lib' -lruby", 
    "LIBRUBY"=>"libruby.so.2.7.1", "LIBRUBY_ALIASES"=>"libruby.so.2.7 libruby.so", 
    "LIBRUBY_SONAME"=>"libruby.so.2.7", "LIBRUBY_SO"=>"libruby.so.2.7.1", 
    "LIBRUBY_A"=>"libruby-static.a", 
    "RUBYW_INSTALL_NAME"=>"", 
    "rubyw_install_name"=>"", 
    "EXTDLDFLAGS"=>"", 
    "EXTLDFLAGS"=>"", 
    "strict_warnflags"=>"-std=gnu99", 
    "warnflags"=>"-Wall -Wextra -Wdeprecated-declarations -Wduplicated-cond -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wwrite-strings -Wimplicit-fallthrough=0 -Wmissing-noreturn -Wno-cast-function-type -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-packed-bitfield-compat -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wsuggest-attribute=format -Wsuggest-attribute=noreturn -Wunused-variable", 
    "debugflags"=>"-ggdb3", 
    "optflags"=>"-O3", 
    "NULLCMD"=>":", 
    "ENABLE_DEBUG_ENV"=>"", 
    "DLNOBJ"=>"dln.o", 
    "INSTALL_STATIC_LIBRARY"=>"no", 
    "MJIT_SUPPORT"=>"yes",
    "EXECUTABLE_EXTS"=>"", 
    "ARCHFILE"=>"", 
    "LIBRUBY_RELATIVE"=>"yes", 
    "EXTOUT"=>".ext",
    "PREP"=>"miniruby", 
    "CROSS_COMPILING"=>"no", 
    "TEST_RUNNABLE"=>"yes", 
    "rubylibprefix"=>"/home/kiran/.rvm/rubies/ruby-2.7.1/lib/ruby", 
    "setup"=>"Setup", 
    "ENCSTATIC"=>"", 
    "EXTSTATIC"=>"", 
    "STRIP"=>"strip -S -x", 
    "SOEXT"=>"so", 
    "TRY_LINK"=>"", 
    "PRELOADENV"=>"LD_PRELOAD", 
    "LIBPATHENV"=>"LD_LIBRARY_PATH", 
    "RPATHFLAG"=>" -Wl,-rpath,%1$-s", 
    "LIBPATHFLAG"=>" -L%1$-s", 
    "LINK_SO"=>"", 
    "ASMEXT"=>"S", 
    "LIBEXT"=>"a", 
    "DLEXT2"=>"", 
    "DLEXT"=>"so", 
    "LDSHAREDXX"=>"g++ -shared", 
    "LDSHARED"=>"gcc -shared", 
    "CCDLFLAGS"=>"-fPIC", 
    "STATIC"=>"", 
    "ARCH_FLAG"=>"", 
    "DLDFLAGS"=>"-Wl,--compress-debug-sections=zlib", 
    "ALLOCA"=>"", 
    "MATHN"=>"yes", 
    "dsymutil"=>"", 
    "codesign"=>"", 
    "POSTLINK"=>":", 
    "WERRORFLAG"=>"-Werror", 
    "CHDIR"=>"cd -P", 
    "RMALL"=>"rm -fr", 
    "RMDIRS"=>"rmdir --ignore-fail-on-non-empty -p", 
    "RMDIR"=>"rmdir --ignore-fail-on-non-empty", 
    "CP"=>"cp", "RM"=>"rm -f", 
    "PKG_CONFIG"=>"pkg-config", 
    "DOXYGEN"=>"", "DOT"=>"", 
    "MAKEDIRS"=>"/usr/bin/mkdir -p", 
    "MKDIR_P"=>"/usr/bin/mkdir -p", 
    "INSTALL_DATA"=>"/usr/bin/install -m 644", 
    "INSTALL_SCRIPT"=>"/usr/bin/install", 
    "INSTALL_PROGRAM"=>"/usr/bin/install", 
    "SET_MAKE"=>"", 
    "LN_S"=>"ln -s", 
    "NM"=>"nm", 
    "DLLWRAP"=>"", 
    "WINDRES"=>"", 
    "OBJCOPY"=>":", 
    "OBJDUMP"=>"objdump", 
    "ASFLAGS"=>"", 
    "AS"=>"as", 
    "ARFLAGS"=>"rcD ", 
    "AR"=>"ar", 
    "RANLIB"=>"ranlib", 
    "try_header"=>"", 
    "CC_VERSION_MESSAGE"=>"gcc (Ubuntu 9.2.1-28ubuntu1) 9.2.1 20200203\nCopyright (C) 2019 Free Software Foundation, Inc.\nThis is free software; see the source for copying conditions.  There is NO\nwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.", 
    "CC_VERSION"=>"gcc --version", 
    "MJIT_CC"=>"/usr/bin/gcc", 
    "CSRCFLAG"=>"", 
    "COUTFLAG"=>"-o ", 
    "OUTFLAG"=>"-o ", 
    "CPPOUTFILE"=>"-o conftest.i", 
    "GNU_LD"=>"yes", 
    "LD"=>"ld", 
    "GCC"=>"yes", 
    "EGREP"=>"/usr/bin/grep -E", 
    "GREP"=>"/usr/bin/grep", 
    "CPP"=>"gcc -E", 
    "CXXFLAGS"=>"-g -O2", 
    "CXX"=>"g++", 
    "OBJEXT"=>"o", 
    "CPPFLAGS"=>"  ", 
    "LDFLAGS"=>"-L. -fstack-protector-strong -rdynamic -Wl,-export-dynamic", 
    "CFLAGS"=>"-O3 -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wduplicated-cond -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wwrite-strings -Wimplicit-fallthrough=0 -Wmissing-noreturn -Wno-cast-function-type -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-packed-bitfield-compat -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wsuggest-attribute=format -Wsuggest-attribute=noreturn -Wunused-variable  -fPIC", 
    "CC"=>"gcc", 
    "target_os"=>"linux", 
    "target_vendor"=>"pc", 
    "target_cpu"=>"x86_64", 
    "target"=>"x86_64-pc-linux-gnu", 
    "host_os"=>"linux-gnu", 
    "host_vendor"=>"pc", 
    "host_cpu"=>"x86_64", 
    "host"=>"x86_64-pc-linux-gnu", 
    "RUBY_VERSION_NAME"=>"ruby-2.7.0", 
    "RUBYW_BASE_NAME"=>"rubyw", 
    "RUBY_BASE_NAME"=>"ruby", 
    "build_os"=>"linux-gnu", 
    "build_vendor"=>"pc", 
    "build_cpu"=>"x86_64", 
    "build"=>"x86_64-pc-linux-gnu", 
    "RUBY_PROGRAM_VERSION"=>"2.7.1", 
    "RUBY_API_VERSION"=>"2.7", 
    "HAVE_GIT"=>"yes", 
    "GIT"=>"git", 
    "cxxflags"=>"", 
    "cppflags"=>"", 
    "cflags"=>"-O3 -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wduplicated-cond -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wwrite-strings -Wimplicit-fallthrough=0 -Wmissing-noreturn -Wno-cast-function-type -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-packed-bitfield-compat -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wsuggest-attribute=format -Wsuggest-attribute=noreturn -Wunused-variable", 
    "target_alias"=>"", 
    "host_alias"=>"", 
    "build_alias"=>"", 
    "LIBS"=>"-lm ", 
    "ECHO_T"=>"", 
    "ECHO_N"=>"-n", 
    "ECHO_C"=>"", 
    "DEFS"=>"", 
    "mandir"=>"/home/kiran/.rvm/rubies/ruby-2.7.1/share/man", 
    "localedir"=>"/home/kiran/.rvm/rubies/ruby-2.7.1/share/locale", 
    "libdir"=>"/home/kiran/.rvm/rubies/ruby-2.7.1/lib", 
    "psdir"=>"/home/kiran/.rvm/rubies/ruby-2.7.1/share/doc/ruby", 
    "pdfdir"=>"/home/kiran/.rvm/rubies/ruby-2.7.1/share/doc/ruby", 
    "dvidir"=>"/home/kiran/.rvm/rubies/ruby-2.7.1/share/doc/ruby", 
    "htmldir"=>"/home/kiran/.rvm/rubies/ruby-2.7.1/share/doc/ruby", 
    "infodir"=>"/home/kiran/.rvm/rubies/ruby-2.7.1/share/info", 
    "docdir"=>"/home/kiran/.rvm/rubies/ruby-2.7.1/share/doc/ruby", 
    "oldincludedir"=>"/usr/include", 
    "includedir"=>"/home/kiran/.rvm/rubies/ruby-2.7.1/include", 
    "runstatedir"=>"/home/kiran/.rvm/rubies/ruby-2.7.1/var/run", 
    "localstatedir"=>"/home/kiran/.rvm/rubies/ruby-2.7.1/var", 
    "sharedstatedir"=>"/home/kiran/.rvm/rubies/ruby-2.7.1/com", 
    "sysconfdir"=>"/etc", "datadir"=>"/home/kiran/.rvm/rubies/ruby-2.7.1/share", 
    "datarootdir"=>"/home/kiran/.rvm/rubies/ruby-2.7.1/share", 
    "libexecdir"=>"/home/kiran/.rvm/rubies/ruby-2.7.1/libexec", 
    "sbindir"=>"/home/kiran/.rvm/rubies/ruby-2.7.1/sbin", 
    "bindir"=>"/home/kiran/.rvm/rubies/ruby-2.7.1/bin", 
    "exec_prefix"=>"/home/kiran/.rvm/rubies/ruby-2.7.1", 
    "PACKAGE_URL"=>"", 
    "PACKAGE_BUGREPORT"=>"", 
    "PACKAGE_STRING"=>"", 
    "PACKAGE_VERSION"=>"", 
    "PACKAGE_TARNAME"=>"", 
    "PACKAGE_NAME"=>"", 
    "PATH_SEPARATOR"=>":", 
    "SHELL"=>"/bin/bash", 
    "UNICODE_VERSION"=>"12.1.0",
    "UNICODE_EMOJI_VERSION"=>"12.1", 
    "archdir"=>"/home/kiran/.rvm/rubies/ruby-2.7.1/lib/ruby/2.7.0/x86_64-linux", 
    "topdir"=>"/home/kiran/.rvm/rubies/ruby-2.7.1/lib/ruby/2.7.0/x86_64-linux"
} 

@kiranparajuli589
Copy link
Author

Now if I do brew link gcc and run gem install nokogiri the response is explained in #2034

@flavorjones
Copy link
Member

Please see CFLAGS in your system:

    "CFLAGS"=>"-O3 -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wduplicated-cond -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wwrite-strings -Wimplicit-fallthrough=0 -Wmissing-noreturn -Wno-cast-function-type -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-packed-bitfield-compat -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wsuggest-attribute=format -Wsuggest-attribute=noreturn -Wunused-variable  -fPIC", 

I'm going to close this ticket since Ruby extensions generally should be compiled with the same compiler and flags as Ruby, and from your RbConfig above it seems RVM build your Ruby with gcc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants