ruby / racc

Racc is an LALR(1) parser generator. It is written in Ruby itself, and generates ruby programs.
Other
536 stars 88 forks source link

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

Closed josephmo closed 1 year ago

josephmo commented 1 year ago
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'

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/joseph-mac/.asdf/installs/ruby/3.1.0/lib/ruby/gems/3.1.0/gems/racc-1.6.1/ext/racc/cparse
/Users/joseph-mac/.asdf/installs/ruby/3.1.0/bin/ruby -I /Users/joseph-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/joseph-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/joseph-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/joseph-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

Gem files will remain installed in /Users/joseph-mac/.asdf/installs/ruby/3.1.0/lib/ruby/gems/3.1.0/gems/racc-1.6.1 for inspection.
Results logged to /Users/joseph-mac/.asdf/installs/ruby/3.1.0/lib/ruby/gems/3.1.0/extensions/x86_64-darwin-21/3.1.0/racc-1.6.1/gem_make.out

  /Users/joseph-mac/.asdf/installs/ruby/3.1.0/lib/ruby/3.1.0/rubygems/ext/builder.rb:95:in `run'
  /Users/joseph-mac/.asdf/installs/ruby/3.1.0/lib/ruby/3.1.0/rubygems/ext/builder.rb:44:in `block in make'
  /Users/joseph-mac/.asdf/installs/ruby/3.1.0/lib/ruby/3.1.0/rubygems/ext/builder.rb:36:in `each'
  /Users/joseph-mac/.asdf/installs/ruby/3.1.0/lib/ruby/3.1.0/rubygems/ext/builder.rb:36:in `make'
  /Users/joseph-mac/.asdf/installs/ruby/3.1.0/lib/ruby/3.1.0/rubygems/ext/ext_conf_builder.rb:63:in `block in build'
  /Users/joseph-mac/.asdf/installs/ruby/3.1.0/lib/ruby/3.1.0/tempfile.rb:317:in `open'
  /Users/joseph-mac/.asdf/installs/ruby/3.1.0/lib/ruby/3.1.0/rubygems/ext/ext_conf_builder.rb:26:in `build'
  /Users/joseph-mac/.asdf/installs/ruby/3.1.0/lib/ruby/3.1.0/rubygems/ext/builder.rb:161:in `build_extension'
  /Users/joseph-mac/.asdf/installs/ruby/3.1.0/lib/ruby/3.1.0/rubygems/ext/builder.rb:195:in `block in build_extensions'
  /Users/joseph-mac/.asdf/installs/ruby/3.1.0/lib/ruby/3.1.0/rubygems/ext/builder.rb:192:in `each'
  /Users/joseph-mac/.asdf/installs/ruby/3.1.0/lib/ruby/3.1.0/rubygems/ext/builder.rb:192:in `build_extensions'
  /Users/joseph-mac/.asdf/installs/ruby/3.1.0/lib/ruby/3.1.0/rubygems/installer.rb:847:in `build_extensions'
  /Users/joseph-mac/.asdf/installs/ruby/3.1.0/lib/ruby/gems/3.1.0/gems/bundler-2.3.8/lib/bundler/rubygems_gem_installer.rb:71:in `build_extensions'
  /Users/joseph-mac/.asdf/installs/ruby/3.1.0/lib/ruby/gems/3.1.0/gems/bundler-2.3.8/lib/bundler/rubygems_gem_installer.rb:28:in `install'
  /Users/joseph-mac/.asdf/installs/ruby/3.1.0/lib/ruby/gems/3.1.0/gems/bundler-2.3.8/lib/bundler/source/rubygems.rb:204:in `install'
  /Users/joseph-mac/.asdf/installs/ruby/3.1.0/lib/ruby/gems/3.1.0/gems/bundler-2.3.8/lib/bundler/installer/gem_installer.rb:54:in `install'
  /Users/joseph-mac/.asdf/installs/ruby/3.1.0/lib/ruby/gems/3.1.0/gems/bundler-2.3.8/lib/bundler/installer/gem_installer.rb:16:in `install_from_spec'
  /Users/joseph-mac/.asdf/installs/ruby/3.1.0/lib/ruby/gems/3.1.0/gems/bundler-2.3.8/lib/bundler/installer/parallel_installer.rb:186:in `do_install'
  /Users/joseph-mac/.asdf/installs/ruby/3.1.0/lib/ruby/gems/3.1.0/gems/bundler-2.3.8/lib/bundler/installer/parallel_installer.rb:177:in `block in worker_pool'
  /Users/joseph-mac/.asdf/installs/ruby/3.1.0/lib/ruby/gems/3.1.0/gems/bundler-2.3.8/lib/bundler/worker.rb:62:in `apply_func'
  /Users/joseph-mac/.asdf/installs/ruby/3.1.0/lib/ruby/gems/3.1.0/gems/bundler-2.3.8/lib/bundler/worker.rb:57:in `block in process_queue'
  /Users/joseph-mac/.asdf/installs/ruby/3.1.0/lib/ruby/gems/3.1.0/gems/bundler-2.3.8/lib/bundler/worker.rb:54:in `loop'
  /Users/joseph-mac/.asdf/installs/ruby/3.1.0/lib/ruby/gems/3.1.0/gems/bundler-2.3.8/lib/bundler/worker.rb:54:in `process_queue'
  /Users/joseph-mac/.asdf/installs/ruby/3.1.0/lib/ruby/gems/3.1.0/gems/bundler-2.3.8/lib/bundler/worker.rb:91:in `block (2 levels) in create_threads'

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
hsbt commented 1 year ago

make: /usr/local/bin/gmkdir: No such file or directory

Can you check your homebrew environment? gmkdir is provided by `coreutils.

josephmo commented 1 year ago

What do you mean by check my homebrew environment?

hsbt commented 1 year ago

?

You should confirm to work gmkdir in your environment.

Unfortunately, It's out of scope for this repository. It seems not racc issue.

josephmo commented 1 year ago

You mean I should check to see if there is a gmkdir on my system?

flavorjones commented 1 year ago

@josephmo This error is happening during the "install" phase, you can probably find the Makefile on disk and look at what it's trying to do by finding the value of INSTALL in your Makefile.

It's likely that Ruby and your system have detected ginstall and so that's what's being used to copy files into the installation directory. But when ginstall tries to call gmkdir to create the needed directories it's failing. @hsbt is saying that this is likely an issue with how these utilities are installed on your machine.

Does that make sense? Do you know how to continue investigating?

josephmo commented 1 year ago

@flavorjones This is getting pulled from a GitHub at bundle time, so I don't have it locally.

longhoangwkm commented 1 year ago

I got this problem too, Confirmed gmkdir works normally a

OS: MacOS Ventura - Version 13.1 Apple M1

flavorjones commented 1 year ago

@longhoangwkm you appear to be experiencing a different problem, your error message is completely different from the OP. please open a new issue if you need assistance!

josephmo commented 1 year ago

The solution was:

brew link --overwrite coreutils