Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Inspect or clean up the working tree error when installing Ruby 2.1.3 on Mac OS X 10.9.5

I'm trying to install Ruby 2.1.3 on Mac OS X 10.9.5 using the rbenv install 2.1.3 command. However I get the error message below. I tried every suggestion on stack overflow and elsewhere. Nothing seems to be working. I currently have the original ruby version that came with 10.9.5, Ruby 2.1.3p242. Brew doctor says everything is fine and rbenv is up to date. Thanks so much! Trying to learn Ruby and Ruby on Rails but I can't get passed this stage.

Inspect or clean up the working tree at /var/folders/zg/s1jqg94n0hjggdnmb442n2lc0000gn/T/ruby-build.20141025184549.88303

Results logged to /var/folders/zg/s1jqg94n0hjggdnmb442n2lc0000gn/T/ruby-build.20141025184549.88303.log

Last 10 log lines:

linking shared-object openssl.bundle

installing default openssl libraries

compiling raddrinfo.c

compiling ifaddr.c

installing default socket libraries

compiling init.c

compiling constants.c

linking shared-object socket.bundle

linking shared-object ripper.bundle

make: [build-ext] Error 2

like image 991
WT0805 Avatar asked Nov 10 '22 00:11

WT0805


2 Answers

I have a m1 mac and I also got this error installing ruby, this command worked for me:

export optflags="-Wno-error=implicit-function-declaration";

run this and then try rbenv install again.

like image 146
Lily Li Avatar answered Nov 15 '22 04:11

Lily Li


Did you try this:

CC=/usr/bin/gcc rbenv install 2.1.3

From this SO answer: Unable to build Ruby 2.1.3 on OSX 10.10 GM 3.0 with rbenv

like image 30
kakubei Avatar answered Nov 15 '22 05:11

kakubei