Error when installing Ruby on M1 Macbook

Posted by Alán

almost 3 years ago

0

m1 mac ruby rbenv

Error message:

- BUILD FAILED (macOS 11.2.3 using ruby-build 20210309) - Inspect or clean up the working tree at `/var/folders/.....`


I tried installing the latest version of Ruby 3.1.2 using:

rbenv install 3.2.1
But got the following error:

 - BUILD FAILED (macOS 11.2.3 using ruby-build 20210309)
 - Inspect or clean up the working tree at `/var/folders/.....`
I managed to fix this by running the following:

CFLAGS="-Wno-error=implicit-function-declaration"
RUBY_CONFIGURE_OPTS='--with-readline-dir=/usr/local/opt/readline/'
arch -x86_64 rbenv install 3.1.2