1

When I run hiptest-publisher on Mac's termainl, I'm getting the following error.

Ignoring executable-hooks-1.6.1 because its extensions are not built. Try: gem pristine executable-hooks --version 1.6.1

So I run gem install executable-hooks -v 1.6.1 and getting the following error. It should related to Apple's new M1 CPU.

Ignoring executable-hooks-1.6.1 because its extensions are not built. Try: gem pristine executable-hooks --version 1.6.1
Error loading RubyGems plugin "/Users/.rvm/rubies/ruby-3.0.0/lib/ruby/gems/3.0.0/plugins/executable-hooks_plugin.rb": cannot load such file -- executable-hooks/wrapper (LoadError)
Building native extensions. This could take a while...
ERROR:  Error installing executable-hooks:
    ERROR: Failed to build gem native extension.

    current directory: /Users/.rvm/gems/ruby-3.0.0/gems/executable-hooks-1.6.1/ext/wrapper_installer
/opt/homebrew/opt/ruby/bin/ruby -I /opt/homebrew/Cellar/ruby/3.1.3/lib/ruby/3.1.0 extconf.rb
/Users/.rvm/gems/ruby-3.0.0/gems/executable-hooks-1.6.1/lib/executable-hooks/regenerate_binstubs_command.rb:101:in `initialize': Permission denied @ rb_sysopen - /opt/homebrew/Cellar/ruby/3.1.3/lib/ruby/gems/3.1.0/bin/rdbg (Errno::EACCES)
    from /Users/.rvm/gems/ruby-3.0.0/gems/executable-hooks-1.6.1/lib/executable-hooks/regenerate_binstubs_command.rb:101:in `open'
    from /Users/.rvm/gems/ruby-3.0.0/gems/executable-hooks-1.6.1/lib/executable-hooks/regenerate_binstubs_command.rb:101:in `block in try_to_fix_binstubs'
    from /Users/.rvm/gems/ruby-3.0.0/gems/executable-hooks-1.6.1/lib/executable-hooks/regenerate_binstubs_command.rb:99:in `map'
    from /Users/.rvm/gems/ruby-3.0.0/gems/executable-hooks-1.6.1/lib/executable-hooks/regenerate_binstubs_command.rb:99:in `try_to_fix_binstubs'
    from /Users/.rvm/gems/ruby-3.0.0/gems/executable-hooks-1.6.1/lib/executable-hooks/regenerate_binstubs_command.rb:76:in `block in execute_no_wrapper'
    from /Users/.rvm/gems/ruby-3.0.0/gems/executable-hooks-1.6.1/lib/executable-hooks/regenerate_binstubs_command.rb:73:in `each'
    from /Users/.rvm/gems/ruby-3.0.0/gems/executable-hooks-1.6.1/lib/executable-hooks/regenerate_binstubs_command.rb:73:in `execute_no_wrapper'
    from extconf.rb:20:in `<main>'
bundler 2.3.26
debug 1.6.3

extconf failed, exit code 1

Gem files will remain installed in /Users/.rvm/gems/ruby-3.0.0/gems/executable-hooks-1.6.1 for inspection.
Results logged to /Users/.rvm/gems/ruby-3.0.0/extensions/arm64-darwin-21/3.1.0/executable-hooks-1.6.1/gem_make.out
user1187968
  • 7,154
  • 16
  • 81
  • 152

1 Answers1

1

You have a shell environment that is confused about where to find Ruby and where to install gems. It's mixing up your Homebrew-installed version of Ruby and your RVM gems.

You should uninstall your Homebrew version of Ruby and ensure that which ruby refers to the version of Ruby that exists in your .rvm directory instead.

  1. brew uninstall ruby
  2. rm -rf ~/.rvm to completely remove RVM, Ruby and gems
  3. Follow the steps at https://stackoverflow.com/a/61375910/3784008 to reinstall RVM and Ruby (make sure you specify the version you need instead of 2.2.2)
  4. Retry gem install executable-hooks -v 1.6.1
anothermh
  • 9,815
  • 3
  • 33
  • 52
  • 1
    Also get used to using `.ruby-version` to specify the ruby to use for each project - you can set a default with RVM, but RVM's strength (or that of `chruby`, etc.) is the ability to have multiple versions installed but select the one to use as appopriate for the project. See [this question](https://stackoverflow.com/questions/15708916/use-rvmrc-or-ruby-version-file-to-set-a-project-gemset-with-rvm) . – Sandy Cash Jan 19 '23 at 22:43