Ruby gem installation in mac fails - ruby

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

Related

gem install puma -v '4.3.7' fails on Mac OS Big Sur Ruby 2.6.3 Bundler version 2.2.19

symptom: gem install puma -v '4.3.7' crashes
• Mac OS Big Sur 11.4
• Ruby 2.6.3
• Bundler version 2.2.19
• Homebrew 3.1.9
jason# % gem install puma -v '4.3.7' --source 'https://rubygems.org/'
Building native extensions. This could take a while...
ERROR: Error installing puma:
ERROR: Failed to build gem native extension.
current directory: /Users/jason/.rvm/gems/ruby-2.6.3/gems/puma-4.3.7/ext/puma_http11
/Users/jason/.rvm/rubies/ruby-2.6.3/bin/ruby -I /Users/jason/.rvm/rubies/ruby-2.6.3/lib/ruby/site_ruby/2.6.0 -r ./siteconf20210611-75981-19nb5m9.rb extconf.rb
checking for BIO_read() in -lcrypto... *** 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
--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/jason/.rvm/rubies/ruby-2.6.3/bin/$(RUBY_BASE_NAME)
--with-puma_http11-dir
--without-puma_http11-dir
--with-puma_http11-include
--without-puma_http11-include=${puma_http11-dir}/include
--with-puma_http11-lib
--without-puma_http11-lib=${puma_http11-dir}/lib
--with-openssl-dir
--without-openssl-dir
--with-openssl-include
--without-openssl-include=${openssl-dir}/include
--with-openssl-lib
--without-openssl-lib=${openssl-dir}/lib
--with-cryptolib
--without-cryptolib
/Users/jason/.rvm/rubies/ruby-2.6.3/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 /Users/jason/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/mkmf.rb:552:in `try_link0'
from /Users/jason/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/mkmf.rb:570:in `try_link'
from /Users/jason/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/mkmf.rb:782:in `try_func'
from /Users/jason/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/mkmf.rb:1016:in `block in have_library'
from /Users/jason/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/mkmf.rb:959:in `block in checking_for'
from /Users/jason/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/mkmf.rb:361:in `block (2 levels) in postpone'
from /Users/jason/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/mkmf.rb:331:in `open'
from /Users/jason/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/mkmf.rb:361:in `block in postpone'
from /Users/jason/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/mkmf.rb:331:in `open'
from /Users/jason/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/mkmf.rb:357:in `postpone'
from /Users/jason/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/mkmf.rb:958:in `checking_for'
from /Users/jason/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/mkmf.rb:1011:in `have_library'
from extconf.rb:13:in `block in <main>'
from extconf.rb:13:in `each'
from extconf.rb:13:in `find'
from extconf.rb:13:in `<main>'
To see why this extension failed to compile, please check the mkmf.log which can be found here:
/Users/jason/.rvm/gems/ruby-2.6.3/extensions/-darwin-20/2.6.0/puma-4.3.7/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in /Users/jason/.rvm/gems/ruby-2.6.3/gems/puma-4.3.7 for inspection.
Results logged to /Users/jason/.rvm/gems/ruby-2.6.3/extensions/-darwin-20/2.6.0/puma-4.3.7/gem_make.out
jason# %
here is the mfmk.log
jason# % more /Users/jason/.rvm/gems/ruby-2.6.3/extensions/-darwin-20/2.6.0/puma-4.3.7/mkmf.log
"gcc -o conftest -I/Users/jason/.rvm/rubies/ruby-2.6.3/include/ruby-2.6.0/-darwin20 -I/Users/jason/.rvm/rubies/ruby-2.6.3/include/ruby-2.6.0/ruby/backward -I/Users/jason/.rvm/rubies/ruby-2.6.3/include/ruby-2.6.0 -I. -I/opt/homebrew/opt/libyaml/include -I/opt/homebrew/opt/libksba/include -I/opt/homebrew/opt/readline/include -I/opt/homebrew/opt/zlib/include -I/opt/homebrew/opt/openssl#1.1/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -O3 -ggdb3 -Wno-error=implicit-function-declaration -fno-common -pipe conftest.c -L. -L/Users/jason/.rvm/rubies/ruby-2.6.3/lib -L/opt/homebrew/opt/libyaml/lib -L/opt/homebrew/opt/libksba/lib -L/opt/homebrew/opt/readline/lib -L/opt/homebrew/opt/zlib/lib -L/opt/homebrew/opt/openssl#1.1/lib -L. -fstack-protector-strong -L/opt/homebrew/opt/libyaml/lib -L/opt/homebrew/opt/libksba/lib -L/opt/homebrew/opt/readline/lib -L/opt/homebrew/opt/zlib/lib -L/opt/homebrew/opt/openssl#1.1/lib -lruby.2.6 "
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: int main(int argc, char **argv)
4: {
5: return 0;
6: }
/* end */
This happens when you fail to install GCC or xcode-select.
Be sure you have xcode-select installed
xcode-select --install
Be sure your version of puma installs
gem install puma -v 'x.y.z'
If neither of these work try
bundle config build.puma --with-cflags="-Wno-error=implicit-function-declaration"
and then re-run bundle install
I faced the same issue when i was trying to install gem for Jekyll.
xcode-select --install
This solved the issue.
I downloaded and installed "Command Line Tools for Xcode 13" from here https://developer.apple.com/download/all/ and it solved the issue for me. xcode-select --install said it was going to take over an hour.

Getting error when installing cocoapods on Mac OS Catalina (10.15.7)

I'm trying to install Cocoapods by executing the below command:
sudo gem install cocoapods
Below error is shown on the Terminal.
Building native extensions. This could take a while...
ERROR: Error installing cocoapods:
ERROR: Failed to build gem native extension.
current directory: /Library/Ruby/Gems/2.6.0/gems/ffi-1.13.1/ext/ffi_c
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby -I /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0 -r ./siteconf20201119-1160-aw1oaf.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.6/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.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:585:in `block in try_compile'
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:534:in `with_werror'
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:585:in `try_compile'
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:1109:in `block in have_header'
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:1108:in `have_header'
from extconf.rb:10:in `system_libffi_usable?'
from extconf.rb:42: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/ffi-1.13.1/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in /Library/Ruby/Gems/2.6.0/gems/ffi-1.13.1 for inspection.
Results logged to /Library/Ruby/Gems/2.6.0/extensions/universal-darwin-19/2.6.0/ffi-1.13.1/gem_make.out
Below is the output of the /Library/Ruby/Gems/2.6.0/extensions/universal-darwin-19/2.6.0/ffi-1.13.1/mkmf.log file.
package configuration for libffi is not found
"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 */
Could anyone please help me fix this issue. Earlier I was getting an error that libffi was missing, I did try installing it by executing the below command, but still unable to install cocoapods.
brew install libffi
Thank you so much for your help in advance!
Installed cocoapods using brew and it worked fine.
brew install cocoapods
Switching to an 11.x version of Xcode command-line tools was enough for me to get
sudo gem install cocoapods
to succeed. I then switched back to the current Xcode and used CocoaPods without problems.
I have both Xcode 12.4 and 11.7 installed under Catalina (10.15.7), so I used Xcode preferences (Locations/Command Line Tools:) to make the switch. Those with just command-line tools installed, not full Xcode packages, can switch between tools versions using Terminal:
xcode-select -p
to see the current tools path and
sudo xcode-select -s {path-to-tools}
to switch versions.

Problem updating Cocoa Pods on OSX 10.12.6

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 */

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

Resources