Intall therubyracer on M1 MacBook Pro (Apple silicon)

I spent few hours to find the solution for this issue. Finally I was able to install therubyracer gem with following steps.

arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
alias ibrew='arch -x86_64 /usr/local/bin/brew'
ibrew install v8@3.15

Once Installed, Exported to PATH

export LDFLAGS="-L/usr/local/opt/v8@3.15/lib"
export CPPFLAGS="-I/usr/local/opt/v8@3.15/include"
gem install therubyracer -v 0.12.3 -- --with-v8-dir=/usr/local/opt/v8@3.15

Leave A Comment