Inspect or clean up the working tree when installing Ruby on Mac M1

10.9k Views Asked by At

I'm trying to install Ruby 2.5.1 by running rbenv install 2.5.1 and keep getting the below failure:

BUILD FAILED (macOS 12.0.1 using ruby-build 20211203)

Inspect or clean up the working tree at /var/folders/_n/7rd4p8r578db_ct2rrwhvwv80000gn/T/ruby-build.20211204124341.35704.JFosKp
Results logged to /var/folders/_n/7rd4p8r578db_ct2rrwhvwv80000gn/T/ruby-build.20211204124341.35704.log

Last 10 log lines:
    rb_mObjSpace = rb_const_get(rb_cObject, rb_intern("ObjectSpace"));
                                            ^~~~~~~~~~~~~~~~~~~~~~~~
../.././include/ruby/ruby.h:1755:56: note: expanded from macro 'rb_intern'
        __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \

Tried everything here and here.

Any ideas what could be causing this?

2

There are 2 best solutions below

1
On

RUBY_CFLAGS="-Wno-error=implicit-function-declaration" rbenv install 2.5.9 its working fine

2
On

Solved it by running $ RUBY_CFLAGS="-Wno-error=implicit-function-declaration" rbenv install 2.5.1