cannot install raakt/hpricot gem - ruby

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'

Related

After upgrading to MAC OS 13(Ventura), an error occurred while installing curb (0.9.11), and Bundler cannot continue

Not able to bundle install due to installation failed with curb 0.9.11. Was working fine with Mac OS 12, but after upgrading to ventura getting above error.
ERROR: Error installing curb:
ERROR: Failed to build gem native extension.
current directory: /Users/ab/.rvm/gems/ruby-2.6.6/gems/curb-0.9.11/ext
/Users/ab/.rvm/rubies/ruby-2.6.6/bin/ruby -I /Users/ab/.rvm/rubies/ruby-2.6.6/lib/ruby/site_ruby/2.6.0 -r ./siteconf20221117-12107-158f8tb.rb extconf.rb
checking for curl-config... yes
checking for curlopt_tcp_keepalive... *** 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/ab/.rvm/rubies/ruby-2.6.6/bin/$(RUBY_BASE_NAME)
--with-curl-dir
--without-curl-dir
--with-curl-include
--without-curl-include=${curl-dir}/include
--with-curl-lib
--without-curl-lib=${curl-dir}/lib
/Users/ab/.rvm/rubies/ruby-2.6.6/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/ab/.rvm/rubies/ruby-2.6.6/lib/ruby/2.6.0/mkmf.rb:585:in `block in try_compile'
from /Users/ab/.rvm/rubies/ruby-2.6.6/lib/ruby/2.6.0/mkmf.rb:534:in `with_werror'
from /Users/ab/.rvm/rubies/ruby-2.6.6/lib/ruby/2.6.0/mkmf.rb:585:in `try_compile'
from extconf.rb:52:in `block in have_constant'
from /Users/ab/.rvm/rubies/ruby-2.6.6/lib/ruby/2.6.0/mkmf.rb:959:in `block in checking_for'
from /Users/ab/.rvm/rubies/ruby-2.6.6/lib/ruby/2.6.0/mkmf.rb:361:in `block (2 levels) in postpone'
from /Users/ab/.rvm/rubies/ruby-2.6.6/lib/ruby/2.6.0/mkmf.rb:331:in `open'
from /Users/ab/.rvm/rubies/ruby-2.6.6/lib/ruby/2.6.0/mkmf.rb:361:in `block in postpone'
from /Users/ab/.rvm/rubies/ruby-2.6.6/lib/ruby/2.6.0/mkmf.rb:331:in `open'
from /Users/ab/.rvm/rubies/ruby-2.6.6/lib/ruby/2.6.0/mkmf.rb:357:in `postpone'
from /Users/ab/.rvm/rubies/ruby-2.6.6/lib/ruby/2.6.0/mkmf.rb:958:in `checking_for'
from extconf.rb:44:in `have_constant'
from extconf.rb:62:in `<main>'
To see why this extension failed to compile, please check the mkmf.log which can be found here:
/Users/ab/.rvm/gems/ruby-2.6.6/extensions/-darwin-21/2.6.0/curb-0.9.11/mkmf.log
extconf failed, exit code 1
not getting successful bundle installation of curb 0.9.11 gem.

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

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.

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

Gem::Ext::BuildError: ERROR: Failed to build gem native extension - nio4r

I am trying to install all gems in my gemfile and its dependencies, so just ran the Bundler (bundle or bundle install). It failed while installing nio4r 1.1.1 with native extensions, below is log in gem_make.out.
/opscode/chef/embedded/bin/ruby.exe -r ./siteconf20150924-7480-ocwr34.rb extconf.rb
checking for unistd.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=/opscode/chef/embedded/bin/ruby
/opscode/chef/embedded/lib/ruby/2.0.0/mkmf.rb:434:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from /opscode/chef/embedded/lib/ruby/2.0.0/mkmf.rb:565:in `try_cpp'
from /opscode/chef/embedded/lib/ruby/2.0.0/mkmf.rb:1038:in `block in have_header'
from /opscode/chef/embedded/lib/ruby/2.0.0/mkmf.rb:889:in `block in checking_for'
from /opscode/chef/embedded/lib/ruby/2.0.0/mkmf.rb:340:in `block (2 levels) in postpone'
from /opscode/chef/embedded/lib/ruby/2.0.0/mkmf.rb:310:in `open'
from /opscode/chef/embedded/lib/ruby/2.0.0/mkmf.rb:340:in `block in postpone'
from /opscode/chef/embedded/lib/ruby/2.0.0/mkmf.rb:310:in `open'
from /opscode/chef/embedded/lib/ruby/2.0.0/mkmf.rb:336:in `postpone'
from /opscode/chef/embedded/lib/ruby/2.0.0/mkmf.rb:888:in `checking_for'
from /opscode/chef/embedded/lib/ruby/2.0.0/mkmf.rb:1037:in `have_header'
from extconf.rb:3:in `'
extconf failed, exit code 1
I can see that the bundler is checking for the unistd.h and failing at that point. I made sure that this header is available within the PATH and also installed the ruby devkit for my version. Doing a gem install nio4r also gives the same error.
try xcode-select --install first.This may be an issue with xcode build system

Resources