gem install not finding ruby.h file

Viewed 147

I am trying to use bundle install to install fastlane. I am having an issue installing one of the dependencies, json 2.6.1. I get the following error.

Fetching json 2.6.1
Installing json 2.6.1 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory:
C:/tools/ruby30/lib/ruby/gems/3.0.0/gems/json-2.6.1/ext/json/ext/generator
C:/tools/ruby30/bin/ruby.exe -I C:/tools/ruby30/lib/ruby/3.0.0 -r
./siteconf20211128-18184-scdpps.rb extconf.rb
creating Makefile

current directory:
C:/tools/ruby30/lib/ruby/gems/3.0.0/gems/json-2.6.1/ext/json/ext/generator
make DESTDIR\= clean

current directory:
C:/tools/ruby30/lib/ruby/gems/3.0.0/gems/json-2.6.1/ext/json/ext/generator
make DESTDIR\=
generating generator-x64-mingw32.def
compiling generator.c
In file included from generator.c:1:
../fbuffer/fbuffer.h:5:10: fatal error: ruby.h: No such file or directory
    5 | #include "ruby.h"
      |          ^~~~~~~~
compilation terminated.
make: *** [Makefile:245: generator.o] Error 1

make failed, exit code 2

Gem files will remain installed in
C:/tools/ruby30/lib/ruby/gems/3.0.0/gems/json-2.6.1 for inspection.
Results logged to
C:/tools/ruby30/lib/ruby/gems/3.0.0/extensions/x64-mingw32/3.0.0/json-2.6.1/gem_make.out

An error occurred while installing json (2.6.1), and Bundler cannot continue.
Make sure that `gem install json -v '2.6.1' --source 'https://rubygems.org/'`
succeeds before bundling.

In Gemfile:
  fastlane was resolved to 2.198.1, which depends on
    json

I have the following specs on my system.

windows 10 ruby 3.0.2p107 (2021-07-07 revision 0db68f0233) [x64-mingw32]

Gemfile

source "https://rubygems.org"
gem "fastlane"

Thanks for the help!

0 Answers
Related