Search code examples
rubyrvmmacos-ventura

Error running '__rvm_make -j8' RVM install on OSX Ventura


Since it's literally been months now I figured I'd finally just get on here and ask. I can't install any version of Ruby at all using RVM on MacOS Ventura. It doesn't seem to be related to problems that other people have had with this. I've tried all the other solutions. But this doesn't seem to be related to OpenSSL or anything like that.

The error I receive is also a bit different than those cases:

Error running '__rvm_make -j8'

For starters... here's the last few lines of the log I get when I run: rvm install 2.6.10

objspace.c:630:23: warning: '(' and '{' tokens introducing statement expression appear in different macro expansion contexts [-Wcompound-token-split-by-macro]
        imemo_type_ids[10] = rb_intern("imemo_parser_strterm");
                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../.././include/ruby/ruby.h:1826:23: note: expanded from macro 'rb_intern'
        __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
                      ^
objspace.c:630:23: note: '{' token is here
        imemo_type_ids[10] = rb_intern("imemo_parser_strterm");
                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../.././include/ruby/ruby.h:1826:24: note: expanded from macro 'rb_intern'
        __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../.././include/ruby/ruby.h:1811:5: note: expanded from macro 'RUBY_CONST_ID_CACHE'
    {                                                   \
    ^
objspace.c:630:23: warning: '}' and ')' tokens terminating statement expression appear in different macro expansion contexts [-Wcompound-token-split-by-macro]
        imemo_type_ids[10] = rb_intern("imemo_parser_strterm");
                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../.././include/ruby/ruby.h:1826:24: note: expanded from macro 'rb_intern'
        __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../.././include/ruby/ruby.h:1816:5: note: expanded from macro 'RUBY_CONST_ID_CACHE'
    }
    ^
objspace.c:630:23: note: ')' token is here
        imemo_type_ids[10] = rb_intern("imemo_parser_strterm");
                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../.././include/ruby/ruby.h:1826:56: note: expanded from macro 'rb_intern'
        __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
                                                       ^
1342 warnings generated.
linking shared-object objspace.bundle
make: *** [build-ext] Error 2
+__rvm_make:0> return 2

I've also installed the latest version of macports (and got its path working correctly) uninstalled and reinstalled OpenSSL. Uninstalled and Reinstalled HomeBrew multiple times... Nothing seems to help.

UPDATE: This is the one error I could find.

error: use of undeclared identifier 'username_completion_function'; did you mean 'rl_username_completion_function'?
        __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \

I searched the logs high and low but couldn't find the second error.


Solution

  • It's going to be difficult discerning exactly what I did to solve this problem. But I'll do my best to backtrace.

    1. Uninstalled Homebrew

    arch -arm64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)"
    

    If you're using an M1 chip then you MUST use the arch -arm64 ahead of every command otherwise it WILL fail.

    2. Deleted ALL Remaining Homebrew Directories

    sudo rm -rf /opt/homebrew
    

    3. Reinstalled Homebrew

    arch -arm64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
    

    The reason for uninstalling Homebrew and getting rid of all its directories is that, if you're like me, you probably tried a MILLION things on your path to getting this to work. Removing Homebrew and its associated directories should wipe out any mistakes you may have made or desperate configuration gambles. To be sure though... you should look for hidden configuration files to make sure none of them reference Ruby.

    4. Use rvm To Install Ruby

    arch -arm64 rvm install 3.2.2
    

    Again you MUST use "arch -arm64" or your install will absolutely fail. Only this time with an Error Code of "1" instead of "2".

    That was it! Install completed. Hope this helps someone.