Home > Blockchain >  An error occurred while installing racc (1.6.1), and Bundler cannot continue
An error occurred while installing racc (1.6.1), and Bundler cannot continue

Time:02-02

HW: Mac Intel silicon
OS: MacOS Ventura - Version 13.1
ruby 3.1.0p0 (2021-12-25 revision fb4df44d16) [x86_64-darwin21]
rails 7.0.2.2

After I installed the MacOS Ventura update, I was getting an error as I was trying to do 'bundle install', and got some errors.

I googled some, and then did the following:

xcode-select --install

When that was finished, I also made sure sure developer tools access to Terminal (through the settings UI).

I ran bundle install again, same results:

Installing racc 1.6.1 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory: /Users/my-mac/.asdf/installs/ruby/3.1.0/lib/ruby/gems/3.1.0/gems/racc-1.6.1/ext/racc/cparse
/Users/my-mac/.asdf/installs/ruby/3.1.0/bin/ruby -I /Users/my-mac/.asdf/installs/ruby/3.1.0/lib/ruby/3.1.0 -r ./siteconf20230126-46139-whcmb7.rb extconf.rb
checking for rb_block_call()... yes
checking for rb_ary_subseq()... yes
creating Makefile

current directory: /Users/my-mac/.asdf/installs/ruby/3.1.0/lib/ruby/gems/3.1.0/gems/racc-1.6.1/ext/racc/cparse
make DESTDIR\= clean

current directory: /Users/my-mac/.asdf/installs/ruby/3.1.0/lib/ruby/gems/3.1.0/gems/racc-1.6.1/ext/racc/cparse
make DESTDIR\=
compiling cparse.c
linking shared-object racc/cparse.bundle
ld: warning: -undefined dynamic_lookup may not work with chained fixups

current directory: /Users/my-mac/.asdf/installs/ruby/3.1.0/lib/ruby/gems/3.1.0/gems/racc-1.6.1/ext/racc/cparse
make DESTDIR\= install
make: /usr/local/bin/gmkdir: No such file or directory
make: *** [.sitearchdir.-.racc.time] Error 1

make install failed, exit code 2

....

An error occurred while installing racc (1.6.1), and Bundler cannot continue.

In Gemfile:
  rails was resolved to 7.0.2.2, which depends on
    actioncable was resolved to 7.0.2.2, which depends on
      actionpack was resolved to 7.0.2.2, which depends on
        actionview was resolved to 7.0.2.2, which depends on
          rails-dom-testing was resolved to 2.0.3, which depends on
            nokogiri was resolved to 1.13.10, which depends on
              racc

bundle install used to work fine. I also checked and I do not have a

/usr/local/bin/gmkdir

or

/opt/local/bin/gmkdir

Any ideas?

CodePudding user response:

That compile process is looking for a gnu version of mkdir with the name ‘gmkdir’. This is an attempt to make the process work on windows.

Since the macOS version of mkdir is probably adequate, you can just create an alias to mkdir called ‘gmkdir’ in /user/local/bin’.

This is a hack until that gem install process is updated to realise that it’s on macOS and doesn’t try to build based on defaults for an unknown OS.

CodePudding user response:

I tried all the suggestions, but none worked. The solution was:

brew link --overwrite coreutils
  • Related