Dani Tseitlin
Dani Tseitlin

Reputation: 1

Unable to install any Ruby version using any Ruby version manager on MacOS M1 Sonoma 14.6.1

I've been trying to install Ruby using any version management for Ruby (RVM, Rbenv, ASDF and also ruby-install directly) and keep getting the same error. for some context: I am trying to install it for my React Native project where I am not able to run bundle install because of some conflicts in the gem file and I want to test out different versions of ruby but I have a suspicion that it's using the system Ruby anyways so I wanted to try an RVM.

This is the error I am getting:

ruby-install 2.7.5                  
>>> Installing ruby 2.7.5 into /Users/my-user/.rubies/ruby-2.7.5 ...
>>> Installing dependencies for ruby 2.7.5 ...
Warning: automake 1.17 is already installed and up-to-date.
To reinstall 1.17, run:
  brew reinstall automake
Warning: bison 3.8.2 is already installed and up-to-date.
To reinstall 3.8.2, run:
  brew reinstall bison
Warning: readline 8.2.13 is already installed and up-to-date.
To reinstall 8.2.13, run:
  brew reinstall readline
Warning: libyaml 0.2.5 is already installed and up-to-date.
To reinstall 0.2.5, run:
  brew reinstall libyaml
Warning: gdbm 1.24 is already installed and up-to-date.
To reinstall 1.24, run:
  brew reinstall gdbm
Warning: libffi 3.4.6 is already installed and up-to-date.
To reinstall 3.4.6, run:
  brew reinstall libffi
Warning: [email protected] 1.1.1w is already installed and up-to-date.
To reinstall 1.1.1w, run:
  brew reinstall [email protected]
>>> Downloading https://cache.ruby-lang.org/pub/ruby/2.7/ruby-2.7.5.tar.xz into /Users/my-user/src ...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 11.5M  100 11.5M    0     0  5299k      0  0:00:02  0:00:02 --:--:-- 5301k
>>> Verifying ruby-2.7.5.tar.xz ...
>>> Extracting ruby-2.7.5.tar.xz to /Users/my-user/src/ruby-2.7.5 ...
>>> Configuring ruby 2.7.5 ...
checking for ruby... /usr/bin/ruby
tool/config.guess already exists
tool/config.sub already exists
checking build system type... aarch64-apple-darwin23.6.0
checking host system type... aarch64-apple-darwin23.6.0
checking target system type... aarch64-apple-darwin23.6.0
checking for gcc... gcc
....
....
checking whether dtrace USDT is available... yes(-xnolibs)
checking whether dtrace needs post processing... no
checking for __builtin_setjmp... (cached) no
checking for _setjmpex as a macro or function... no
checking for _setjmp as a macro or function... yes
checking for sigsetjmp as a macro or function... yes
checking for setjmp type... sigsetjmp,0
checking for prefix of external symbols... _
checking pthread.h usability... yes
checking pthread.h presence... yes
checking for pthread.h... yes
checking if make is GNU make... make ℹ info Invoking all target
node:internal/process/promises:246
          triggerUncaughtException(err, true /* fromPromise */);
          ^

[UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "undefined".] {
  code: 'ERR_UNHANDLED_REJECTION'
}
no
checking for safe null command for make... configure: error: no candidate for safe null command
!!! Configuration of ruby 2.7.5 failed!
my-user@Danis-MacBook-Pro-6 ~ % 

My $PATH variable contents:

/Users/my-user/.nvm/versions/node/v16.13.1/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Library/Apple/usr/bin:/usr/local/share/dotnet:~/.dotnet/tools:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Users/my-user/.cargo/bin:/Users/my-user/.rvm/bin

I am also looking for tips on how to debug this at all. Thanks.

I tried installing ruby using RVM, RBENV, Ruby-install and nothing worked with the same failure.

Upvotes: 0

Views: 116

Answers (1)

Holger Just
Holger Just

Reputation: 55758

It seems that something in your macOS configuration results in node being executed during installation (which is unexpected here). This may be caused by aliases, shell functions or path overrides which you may have setup in your shell.

Depending on how you have setup your $PATH variable in your shell's init files, if you have installed e.g. the npm make package, its make executable may shadow the make command which is part of the C compiler suite and whioch is required to build Ruby.

To fix this, ensure that your shell's $PATH variable is correctly setup so that your node / npm executables do not shadow system executables. The paths to NPM / nodejs executables should likely be after paths like /usr/local/bin and /opt/local/bin.

Upvotes: 0

Related Questions