recolog

@t0m0120

bundle update fastlane した際に jsonのupdateで失敗する

February 11, 2021

Installing json 2.5.1 (was 2.3.1) with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory: /private/var/folders/4g/_x5y5c6j6231xsnxkmsllxb80000gn/T/bundler20210209-6937-7rx9k4json-2.5.1/gems/json-2.5.1/ext/json/ext/generator
/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 ./siteconf20210209-6937-1x28fca.rb extconf.rb
creating Makefile

current directory: /private/var/folders/4g/_x5y5c6j6231xsnxkmsllxb80000gn/T/bundler20210209-6937-7rx9k4json-2.5.1/gems/json-2.5.1/ext/json/ext/generator
make "DESTDIR=" clean

current directory: /private/var/folders/4g/_x5y5c6j6231xsnxkmsllxb80000gn/T/bundler20210209-6937-7rx9k4json-2.5.1/gems/json-2.5.1/ext/json/ext/generator
make "DESTDIR="
compiling generator.c
In file included from generator.c:1:
In file included from ./../fbuffer/fbuffer.h:5:
In file included from
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby.h:33:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.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"
         ^~~~~~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.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/MacOSX.sdk/System/Library/Frameworks')
1 error generated.
make: *** [generator.o] Error 1

make failed, exit code 2

Gem files will remain installed in /var/folders/4g/_x5y5c6j6231xsnxkmsllxb80000gn/T/bundler20210209-6937-7rx9k4json-2.5.1/gems/json-2.5.1 for inspection.
Results logged to /var/folders/4g/_x5y5c6j6231xsnxkmsllxb80000gn/T/bundler20210209-6937-7rx9k4json-2.5.1/extensions/universal-darwin-19/2.6.0/json-2.5.1/gem_make.out

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

In Gemfile:
  cocoapods was resolved to 1.9.1, which depends on
    cocoapods-core was resolved to 1.9.1, which depends on
      algoliasearch was resolved to 1.27.3, which depends on

下記Stackoverflow参考で治った
macOS Mojave ‘ruby/config.h’ file not found

cd /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby
ln -sf ../../../../Headers/ruby/config.h