My Gemfile (Bundle install) is breaking using macos Bigsur - Could not find json-2.3.1 in any of the sources

Asked

Viewed 68 times

0

Generally I use Bundle to install the cocoapods by configuring the Gemfile files:

source 'https://rubygems.org'

gem 'cocoapods', '>= 1.9.0'

And then installing the bungler.

$ bundle install

And after the Macos Bigsur update, the bumdle installation no longer works: This is the error:

An error occurred while installing json (2.3.1), and Bundler cannot continue.
Installing json 2.3.1 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory: /private/var/folders/47/661pdlmd1qn3vslck_r54c480000gp/T/bundler20201204-92698-44fx9djson-2.3.1/gems/json-2.3.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
./siteconf20201204-92698-1igj5ij.rb extconf.rb
creating Makefile

current directory: /private/var/folders/47/661pdlmd1qn3vslck_r54c480000gp/T/bundler20201204-92698-44fx9djson-2.3.1/gems/json-2.3.1/ext/json/ext/generator
make "DESTDIR=" clean

current directory: /private/var/folders/47/661pdlmd1qn3vslck_r54c480000gp/T/bundler20201204-92698-44fx9djson-2.3.1/gems/json-2.3.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/MacOSX10.15.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/MacOSX10.15.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/MacOSX10.15.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
'/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/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/47/661pdlmd1qn3vslck_r54c480000gp/T/bundler20201204-92698-44fx9djson-2.3.1/gems/json-2.3.1 for inspection.
Results logged to /var/folders/47/661pdlmd1qn3vslck_r54c480000gp/T/bundler20201204-92698-44fx9djson-2.3.1/extensions/universal-darwin-20/2.6.0/json-2.3.1/gem_make.out

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

In Gemfile:
  cocoapods was resolved to 1.10.0, which depends on
    cocoapods-core was resolved to 1.10.0, which depends on
      algoliasearch was resolved to 1.27.5, which depends on
        json

1 answer

1


The solution found was :

1 - brew update and sudo brew update.

2 - brew install rbenv << if gave error here goes to 3 , if it does not continue to 4.

3 - Set Xcode 12 to Default .

3.1 - sudo rm -rf /Library/Developer/CommandLineTools ... removes the commandLineTools

3.2 - sudo xcode-select --install ... install again with Xcode 12 set to grab the tools from Bigsur

3.3 - brew install rbenv

4 - rbenv init

5 - bundler install

For me these steps have worked :)

Browser other questions tagged

You are not signed in. Login or sign up in order to post.