ajmaleylia

Hi, I'm Ajmal
Tech Consultant

RVM error when installing Ruby version 3.3.0 on Apple M Chip

I encountered an issue while attempting to install Ruby 3.3.0 using RVM on my Apple M1 machine. When I executed rvm install 3.3.0, RVM began compiling Ruby from source. During this process, it needs to link against OpenSSL for compiling Ruby. If RVM cannot find OpenSSL or detects an incorrect version, it fails and throws an error:

Error running '__rvm_make -j8'

Solution: Specifying OpenSSL Directory

The error occurred because RVM couldn’t locate the OpenSSL library for compiling Ruby. To resolve this issue, you need to specify the path to OpenSSL:

rvm install 3.3.0 --with-openssl-dir=$(brew --prefix openssl)

That’s it! This command tells RVM to use the OpenSSL version installed by Homebrew.

Install Ruby with YJIT

If you want to use YJIT (Just-In-Time compilation) for your Ruby application, you need to install Rust before installing Ruby 3.3.0:

# Install Rust using rustup
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

rvm install 3.3.0 --with-openssl-dir=$(brew --prefix openssl)

# Verify YJIT
ruby -v --yjit
ruby 3.3.0 (2023-12-25 revision 5124f9ac75) +YJIT [arm64-darwin23]

Running this command will install Ruby version 3.3.0 with YJIT enabled, which can improve the performance of your application.


This issue is absolutely related to newer macOS versions , OpenSSL 3 , and Homebrew’s package management .

Notes