Problem updating Cocoa Pods on OSX 10.12.6 - cocoapods

I'm trying to update cocoa pods in order to build an iOS version of an Ionic/Capacitor project but I keep getting the following error:
ERROR: Failed to build gem native extension.
I tried uninstalling and reinstalling, but no joy. I also tried the troubleshooting options on the cocoa pods site.
More info:
current directory: /Library/Ruby/Gems/2.3.0/gems/ffi-1.12.2/ext/ffi_c
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby -r ./siteconf20200415-1988-1gtlurs.rb extconf.rb
checking for ffi.h... *** 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=/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/$(RUBY_BASE_NAME)
--with-ffi_c-dir
--without-ffi_c-dir
--with-ffi_c-include
--without-ffi_c-include=${ffi_c-dir}/include
--with-ffi_c-lib
--without-ffi_c-lib=${ffi_c-dir}/lib
--enable-system-libffi
--disable-system-libffi
--with-libffi-config
--without-libffi-config
--with-pkg-config
--without-pkg-config
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/mkmf.rb:456:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/mkmf.rb:571:in `block in try_compile'
from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/mkmf.rb:524:in `with_werror'
from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/mkmf.rb:571:in `try_compile'
from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/mkmf.rb:1091:in `block in have_header'
from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/mkmf.rb:942:in `block in checking_for'
from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/mkmf.rb:350:in `block (2 levels) in postpone'
from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/mkmf.rb:320:in `open'
from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/mkmf.rb:350:in `block in postpone'
from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/mkmf.rb:320:in `open'
from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/mkmf.rb:346:in `postpone'
from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/mkmf.rb:941:in `checking_for'
from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/mkmf.rb:1090:in `have_header'
from extconf.rb:10:in `system_libffi_usable?'
from extconf.rb:34:in `<main>'
Log file:
package configuration for libffi is not found
"xcrun clang -o conftest -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/include/ruby-2.3.0/universal-darwin16 -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/include/ruby-2.3.0/ruby/backward -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/include/ruby-2.3.0 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -g -Os -pipe -DHAVE_GCC_ATOMIC_BUILTINS -iwithsysroot /usr/local/libressl/include conftest.c -L. -L/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib -L. -L /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.Internal.sdk/usr/local/libressl/lib -L/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.Internal.sdk/usr/local/lib -arch x86_64 -arch i386 -lruby.2.3.0 -lpthread -ldl -lobjc "
In file included from conftest.c:1:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/include/ruby-2.3.0/ruby.h:33:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/include/ruby-2.3.0/ruby/ruby.h:24:10: fatal error: 'ruby/config.h' file not found
#include "ruby/config.h"
^~~~~~~~~~~~~~~
1 error generated.
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: int main(int argc, char **argv)
4: {
5: return 0;
6: }
/* end */

Related

Ruby gem installation in mac fails

I tried to install "slather" using below command:
gem install slather
I am getting below errors one by one:
ERROR: While executing gem ... (Errno::EACCES)
Permission denied # rb_sysopen - /Library/Ruby/Gems/2.6.0/gems/racc-1.5.2/COPYING
if I use sudo gem install slather then I am getting following errors:
Building native extensions. This could take a while...
ERROR: Error installing slather:
ERROR: Failed to build gem native extension.
current directory: /Library/Ruby/Gems/2.6.0/gems/racc-1.5.2/ext/racc/cparse
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby -I /Library/Ruby/Site/2.6.0 -r ./siteconf20210423-2061-77fpx8.rb extconf.rb
checking for rb_ary_subseq()... *** 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=/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/$(RUBY_BASE_NAME)
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:467:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:546:in `block in try_link0'
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/tmpdir.rb:93:in `mktmpdir'
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:543:in `try_link0'
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:570:in `try_link'
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:782:in `try_func'
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:1069:in `block in have_func'
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:959:in `block in checking_for'
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:361:in `block (2 levels) in postpone'
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:331:in `open'
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:361:in `block in postpone'
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:331:in `open'
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:357:in `postpone'
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:958:in `checking_for'
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:1068:in `have_func'
from extconf.rb:6:in `<main>'
To see why this extension failed to compile, please check the mkmf.log which can be found here:
/Library/Ruby/Gems/2.6.0/extensions/universal-darwin-19/2.6.0/racc-1.5.2/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in /Library/Ruby/Gems/2.6.0/gems/racc-1.5.2 for inspection.
Results logged to /Library/Ruby/Gems/2.6.0/extensions/universal-darwin-19/2.6.0/racc-1.5.2/gem_make.out
I have checked the mentioned log file as well
/Library/Ruby/Gems/2.6.0/extensions/universal-darwin-19/2.6.0/racc-1.5.2/mkmf.log
here is the log printed:
"xcrun clang -o conftest -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/universal-darwin19 -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/backward -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -g -Os -pipe -DHAVE_GCC_ATOMIC_BUILTINS conftest.c -L. -L/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib -L. -L/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.Internal.sdk/usr/local/lib -arch x86_64 -lruby.2.6 "
In file included from conftest.c:1:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby.h:33:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:24:10: fatal error: 'ruby/config.h' file not found
#include "ruby/config.h"
^~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:24:10: note: did not find header 'config.h' in framework 'ruby' (loaded from '/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Frameworks')
1 error generated.
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: int main(int argc, char **argv)
4: {
5: return 0;
6: }
/* end */
I have no clue about why its happening, I have already installed xcode command line tools and all.
Do you have Xcode installed on your mac? if not download it from the Mac app store. or install from the command line using xcode-select --install

cannot install raakt/hpricot gem

I'm absolutely a ruby beginner. I am trying to install raakt. This installation is failing - I think because of a dependency on another gem called hpricot. So I take a step back and try to install hpricot first:
install gem hpricot
Output as follows:
C:\Users\Administrator\source\repos\rss>gem install hpricot
Temporarily enhancing PATH for MSYS/MINGW...
Building native extensions. This could take a while...
ERROR: Error installing hpricot:
ERROR: Failed to build gem native extension.
current directory: C:/tools/ruby26/lib/ruby/gems/2.6.0/gems/hpricot-0.8.6/ex
t/fast_xs
C:/tools/ruby26/bin/ruby.exe -I C:/tools/ruby26/lib/ruby/2.6.0 -r ./siteconf2019
1204-7324-62if1j.rb extconf.rb
checking for stdio.h... *** 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=C:/tools/ruby26/bin/$(RUBY_BASE_NAME)
C:/tools/ruby26/lib/ruby/2.6.0/mkmf.rb:467:in `try_do': The compiler failed to g
enerate an executable file. (RuntimeError)
You have to install development tools first.
from C:/tools/ruby26/lib/ruby/2.6.0/mkmf.rb:601:in `try_cpp'
from C:/tools/ruby26/lib/ruby/2.6.0/mkmf.rb:1109:in `block in have_heade
r'
from C:/tools/ruby26/lib/ruby/2.6.0/mkmf.rb:959:in `block in checking_fo
r'
from C:/tools/ruby26/lib/ruby/2.6.0/mkmf.rb:361:in `block (2 levels) in
postpone'
from C:/tools/ruby26/lib/ruby/2.6.0/mkmf.rb:331:in `open'
from C:/tools/ruby26/lib/ruby/2.6.0/mkmf.rb:361:in `block in postpone'
from C:/tools/ruby26/lib/ruby/2.6.0/mkmf.rb:331:in `open'
from C:/tools/ruby26/lib/ruby/2.6.0/mkmf.rb:357:in `postpone'
from C:/tools/ruby26/lib/ruby/2.6.0/mkmf.rb:958:in `checking_for'
from C:/tools/ruby26/lib/ruby/2.6.0/mkmf.rb:1108:in `have_header'
from extconf.rb:2:in `<main>'
To see why this extension failed to compile, please check the mkmf.log which can
be found here:
C:/tools/ruby26/lib/ruby/gems/2.6.0/extensions/x64-mingw32/2.6.0/hpricot-0.8.6
/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in C:/tools/ruby26/lib/ruby/gems/2.6.0/gems/hpri
cot-0.8.6 for inspection.
Results logged to C:/tools/ruby26/lib/ruby/gems/2.6.0/extensions/x64-mingw32/2.6
.0/hpricot-0.8.6/gem_make.out
C:\Users\Administrator\source\repos\rss>
gem_make.out log:
current directory: C:/tools/ruby26/lib/ruby/gems/2.6.0/gems/hpricot-0.8.6/ext/fast_xs
C:/tools/ruby26/bin/ruby.exe -I C:/tools/ruby26/lib/ruby/2.6.0 -r ./siteconf20191204-2592-obt2lm.rb extconf.rb
checking for stdio.h... *** 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=C:/tools/ruby26/bin/$(RUBY_BASE_NAME)
C:/tools/ruby26/lib/ruby/2.6.0/mkmf.rb:467:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from C:/tools/ruby26/lib/ruby/2.6.0/mkmf.rb:601:in `try_cpp'
from C:/tools/ruby26/lib/ruby/2.6.0/mkmf.rb:1109:in `block in have_header'
from C:/tools/ruby26/lib/ruby/2.6.0/mkmf.rb:959:in `block in checking_for'
from C:/tools/ruby26/lib/ruby/2.6.0/mkmf.rb:361:in `block (2 levels) in postpone'
from C:/tools/ruby26/lib/ruby/2.6.0/mkmf.rb:331:in `open'
from C:/tools/ruby26/lib/ruby/2.6.0/mkmf.rb:361:in `block in postpone'
from C:/tools/ruby26/lib/ruby/2.6.0/mkmf.rb:331:in `open'
from C:/tools/ruby26/lib/ruby/2.6.0/mkmf.rb:357:in `postpone'
from C:/tools/ruby26/lib/ruby/2.6.0/mkmf.rb:958:in `checking_for'
from C:/tools/ruby26/lib/ruby/2.6.0/mkmf.rb:1108:in `have_header'
from extconf.rb:2:in `<main>'
To see why this extension failed to compile, please check the mkmf.log which can be found here:
C:/tools/ruby26/lib/ruby/gems/2.6.0/extensions/x64-mingw32/2.6.0/hpricot-0.8.6/mkmf.log
extconf failed, exit code 1
Can anyone suggest a way I can get this installed or have some trouble-shooting tips?
Log looks like this:
"x86_64-w64-mingw32-gcc -o conftest.exe -IC:/tools/ruby26/include/ruby-2.6.0/x64-mingw32 -IC:/tools/ruby26/include/ruby-2.6.0/ruby/backward -IC:/tools/ruby26/include/ruby-2.6.0 -I. -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0600 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64 -O3 -fno-fast-math conftest.c -L. -LC:/tools/ruby26/lib -L. -pipe -s -lx64-msvcrt-ruby260 -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi "
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <winsock2.h>
4: #include <windows.h>
5: int main(int argc, char **argv)
6: {
7: return 0;
8: }
/* end */
Full gemfile
source 'http://rubygems.org'
gem 'rake', '10.5.0'
gem 'albacore', '2.3.22'
gem 'business_time', '0.8.0'
gem 'nokogiri'
gem 'octokit', '4.3.0'
#gem 'hpricot'
#gem 'raakt'

Couldn't install http-cookie gem [duplicate]

This question already has answers here:
Installing RubyGems in Windows
(8 answers)
Closed 5 years ago.
I need just to execute one .rb file but it needs a lot of additional libraries. Some of them were installed but I have problems with http-cookie. It says:
$>gem install -http-proxy http://myproxy:8888 http-cookie
Temporarily enhancing PATH for MSYS/MINGW...
Building native extensions. This could take a while...
ERROR: Error installing http-cookie:
ERROR: Failed to build gem native extension.
current directory: C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/unf_ext-0.0.7.4/ext/unf_ext
C:/Ruby24-x64/bin/ruby.exe -r ./siteconf20180126-8844-1titamy.rb extconf.rb
checking for -lstdc++... *** 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=C:/Ruby24-x64/bin/$(RUBY_BASE_NAME)
--with-static-libstdc++
--without-static-libstdc++
--with-stdc++lib
--without-stdc++lib
C:/Ruby24-x64/lib/ruby/2.4.0/mkmf.rb:457:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from C:/Ruby24-x64/lib/ruby/2.4.0/mkmf.rb:542:in `try_link0'
from C:/Ruby24-x64/lib/ruby/2.4.0/mkmf.rb:557:in `try_link'
from C:/Ruby24-x64/lib/ruby/2.4.0/mkmf.rb:775:in `try_func'
from C:/Ruby24-x64/lib/ruby/2.4.0/mkmf.rb:1002:in `block in have_library'
from C:/Ruby24-x64/lib/ruby/2.4.0/mkmf.rb:945:in `block in checking_for'
from C:/Ruby24-x64/lib/ruby/2.4.0/mkmf.rb:351:in `block (2 levels) in postpone'
from C:/Ruby24-x64/lib/ruby/2.4.0/mkmf.rb:321:in `open'
from C:/Ruby24-x64/lib/ruby/2.4.0/mkmf.rb:351:in `block in postpone'
from C:/Ruby24-x64/lib/ruby/2.4.0/mkmf.rb:321:in `open'
from C:/Ruby24-x64/lib/ruby/2.4.0/mkmf.rb:347:in `postpone'
from C:/Ruby24-x64/lib/ruby/2.4.0/mkmf.rb:944:in `checking_for'
from C:/Ruby24-x64/lib/ruby/2.4.0/mkmf.rb:997:in `have_library' from extconf.rb:6:in `<main>'
To see why this extension failed to compile, please check the mkmf.log which can be found here:
C:/Ruby24-x64/lib/ruby/gems/2.4.0/extensions/x64-mingw32/2.4.0/unf_ext-0.0.7.4/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/unf_ex
t-0.0.7.4 for inspection.
Results logged to C:/Ruby24-x64/lib/ruby/gems/2.4.0/extensions/x64-mingw32/2.4.0
/unf_ext-0.0.7.4/gem_make.out
mkmf.log:
"x86_64-w64-mingw32-gcc -o conftest.exe -IC:/Ruby24-x64/include/ruby-2.4.0/x64-mingw32 -IC:/Ruby24-x64/include/ruby-2.4.0/ruby/backward -IC:/Ruby24-x64/include/ruby-2.4.0 -I. -D_FORTIFY_SOURCE=2 -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0501 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64 -march=x86-64 -mtune=generic -O2 -pipe conftest.c -L. -LC:/Ruby24-x64/lib -L. -pipe -lx64-msvcrt-ruby240 -lgmp -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi "
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <winsock2.h>
4: #include <windows.h>
5: int main(int argc, char **argv)
6: {
7: return 0;
8: }
/* end */
I used Rubygems v2.7.4.
Please help with any advice!
Thanks you in advance!
Install the ruby development-kit for windows

installing jekyll gives returns error (Failed to build gem native extension.)

I have a fresh install of fedora. I installed ruby, ruby-devel and gone through jekyll troubleshooting on their website but i still get the same error. I tried installing another gem which is Sass, just to make sure its not a ruby issue and it successfully installed.
Building native extensions. This could take a while...
ERROR: Error installing jekyll:
ERROR: Failed to build gem native extension.
current directory: /usr/local/share/gems/gems/ffi-1.9.10/ext/ffi_c
/usr/bin/ruby -r ./siteconf20160620-3296-7ascyu.rb extconf.rb
checking for ffi.h... *** 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}/lib64
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/usr/bin/$(RUBY_BASE_NAME)
--with-ffi_c-dir
--without-ffi_c-dir
--with-ffi_c-include
--without-ffi_c-include=${ffi_c-dir}/include
--with-ffi_c-lib
--without-ffi_c-lib=${ffi_c-dir}/lib64
--with-libffi-config
--without-libffi-config
--with-pkg-config
--without-pkg-config
/usr/share/ruby/mkmf.rb:456:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from /usr/share/ruby/mkmf.rb:587:in `try_cpp'
from /usr/share/ruby/mkmf.rb:1060:in `block in have_header'
from /usr/share/ruby/mkmf.rb:911:in `block in checking_for'
from /usr/share/ruby/mkmf.rb:351:in `block (2 levels) in postpone'
from /usr/share/ruby/mkmf.rb:321:in `open'
from /usr/share/ruby/mkmf.rb:351:in `block in postpone'
from /usr/share/ruby/mkmf.rb:321:in `open'
from /usr/share/ruby/mkmf.rb:347:in `postpone'
from /usr/share/ruby/mkmf.rb:910:in `checking_for'
from /usr/share/ruby/mkmf.rb:1059:in `have_header'
from extconf.rb:16:in `<main>'
To see why this extension failed to compile, please check the mkmf.log which can be found here:
/usr/local/lib64/gems/ruby/ffi-1.9.10/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in /usr/local/share/gems/gems/ffi-1.9.10 for inspection.
Results logged to /usr/local/lib64/gems/ruby/ffi-1.9.10/gem_make.out
info from mkmf.log:
package configuration for libffi is not found
"gcc -o conftest -I/usr/include -I/usr/include/ruby/backward -I/usr/include -I. -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -mtune=generic -fPIC conftest.c -L. -L/usr/lib64 -L. -Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -fstack-protector -rdynamic -Wl,-export-dynamic -m64 -lruby -lpthread -ldl -lcrypt -lm -lc"
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: int main(int argc, char **argv)
4: {
5: return 0;
6: }
/* end */
PS: I have ruby 2.2.5p319 (2016-04-26 revision 54774) [x86_64-linux]
and gem 2.6.4 and ruby-devel-2.2.5-48.fc23.x86_64
With CentOS 6 & 7 you can encounter the same issue, even if you have installed ruby && ruby-devel.
To solve this, install gcc & make.
I solved the issue by installing RVM. it automatically installed Ruby 2.3.0 and then i tried gem install jekyll, and it installed successfully.

Can't build gem native extensions

I'm not too sure why, but I can't seem to install any gem that involves building native extensions. Can anyone suggest how to start debugging this issue? Here's the output I get with gem install debugger
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/Users/Chintan/.rvm/rubies/ruby-1.9.3-p0/bin/ruby extconf.rb
checking for rb_method_entry_t.called_id in method.h... *** 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=/Users/Chintan/.rvm/rubies/ruby-1.9.3-p0/bin/ruby
--with-ruby-dir
--without-ruby-dir
--with-ruby-include=${ruby-dir}/include
--with-ruby-lib
--without-ruby-lib=${ruby-dir}/lib
/Users/Chintan/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:381:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from /Users/Chintan/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:491:in `block in try_compile'
from /Users/Chintan/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:443:in `with_werror'
from /Users/Chintan/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:491:in `try_compile'
from /Users/Chintan/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:1002:in `block in have_struct_member'
from /Users/Chintan/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:790:in `block in checking_for'
from /Users/Chintan/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:284:in `block (2 levels) in postpone'
from /Users/Chintan/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:254:in `open'
from /Users/Chintan/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:284:in `block in postpone'
from /Users/Chintan/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:254:in `open'
from /Users/Chintan/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:280:in `postpone'
from /Users/Chintan/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:789:in `checking_for'
from /Users/Chintan/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:1001:in `have_struct_member'
from extconf.rb:34:in `block in <main>'
from /Users/Chintan/.rvm/gems/ruby-1.9.3-p0/gems/debugger-ruby_core_source-1.2.3/lib/debugger/ruby_core_source.rb:21:in `call'
from /Users/Chintan/.rvm/gems/ruby-1.9.3-p0/gems/debugger-ruby_core_source-1.2.3/lib/debugger/ruby_core_source.rb:21:in `create_makefile_with_core'
from extconf.rb:87:in `<main>'
Gem files will remain installed in /Users/Chintan/.rvm/gems/ruby-1.9.3-p0/gems/debugger-1.6.0 for inspection.
Results logged to /Users/Chintan/.rvm/gems/ruby-1.9.3-p0/gems/debugger-1.6.0/ext/ruby_debug/gem_make.out
An error occurred while installing debugger (1.6.0), and Bundler cannot continue.
Also, I recently re-installed homebrew, so that might be the issue? And I've definitely got the XCode Developre Tools installed.
Here's the contents of mkmf.log:
○ cat /Users/Chintan/.rvm/gems/ruby-1.9.3-p0/gems/debugger-1.6.0/ext/ruby_debug/mkmf.log
"/usr/local/bin/gcc-4.2 -o conftest -I/Users/Chintan/.rvm/rubies/ruby-1.9.3-p0/include/ruby-1.9.1/x86_64-darwin12.2.1 -I/Users/Chintan/.rvm/rubies/ruby-1.9.3-p0/include/ruby-1.9.1/ruby/backward -I/Users/Chintan/.rvm/rubies/ruby-1.9.3-p0/include/ruby-1.9.1 -I. -I/Users/Chintan/.rvm/src/ruby-1.9.3-p0 -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -I/Users/Chintan/.rvm/usr/include -fno-common -pipe conftest.c -L. -L/Users/Chintan/.rvm/rubies/ruby-1.9.3-p0/lib -L. -L/Users/Chintan/.rvm/usr/lib -lruby.1.9.1 -lpthread -ldl -lobjc "
/Users/Chintan/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:317: warning: Insecure world writable dir /usr/local/heroku/bin in PATH, mode 040777
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: int main() {return 0;}
/* end */
This worked for me:
gem update debugger-ruby_core_source

Resources