Help : Ruby Build Failed


#1

I am trying to follow the instructions for installing ruby using rbenv and I can’t get it to work.
I’m folling the instructions here: https://www.theodinproject.com/courses/web-development-101/lessons/installing-ruby?ref=lnav

I previously had rmv installed and I did my best to remove it (including traces in bashrc and bash_profile but I don’t know if there are remnants. Nor do I know if that’s why rbenv is failing but I do know that the two are incompatible so I’m just trying stuff :wink:

Here is what terminal says when I try to install 2.6.1:

    ruby-build: use openssl from homebrew
/var/folders/ft/dfd4d0l56m73psd1n5zkn41c0000gn/T/ruby-build.20190301172635.3176 ~
Downloading ruby-2.6.1.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.6/ruby-2.6.1.tar.bz2
/var/folders/ft/dfd4d0l56m73psd1n5zkn41c0000gn/T/ruby-build.20190301172635.3176/ruby-2.6.1 /var/folders/ft/dfd4d0l56m73psd1n5zkn41c0000gn/T/ruby-build.20190301172635.3176 ~
Installing ruby-2.6.1...
ruby-build: use readline from homebrew
checking for ruby... /usr/bin/ruby
tool/config.guess already exists
tool/config.sub already exists
checking build system type... x86_64-apple-darwin18.0.0
checking host system type... x86_64-apple-darwin18.0.0
checking target system type... x86_64-apple-darwin18.0.0
checking whether the C compiler works... no
configure: error: in `/var/folders/ft/dfd4d0l56m73psd1n5zkn41c0000gn/T/ruby-build.20190301172635.3176/ruby-2.6.1':
configure: error: C compiler cannot create executables
See `config.log' for more details
make: *** No targets specified and no makefile found.  Stop.

BUILD FAILED (OS X 10.14 using ruby-build 20190130)

Inspect or clean up the working tree at /var/folders/ft/dfd4d0l56m73psd1n5zkn41c0000gn/T/ruby-build.20190301172635.3176
Results logged to /var/folders/ft/dfd4d0l56m73psd1n5zkn41c0000gn/T/ruby-build.20190301172635.3176.log

Last 10 log lines:
tool/config.guess already exists
tool/config.sub already exists
checking build system type... x86_64-apple-darwin18.0.0
checking host system type... x86_64-apple-darwin18.0.0
checking target system type... x86_64-apple-darwin18.0.0
checking whether the C compiler works... no
configure: error: in `/var/folders/ft/dfd4d0l56m73psd1n5zkn41c0000gn/T/ruby-build.20190301172635.3176/ruby-2.6.1':
configure: error: C compiler cannot create executables
See `config.log' for more details
make: *** No targets specified and no makefile found.  Stop.

#2

I am getting the same error trying to install Ruby version 2.6.1 on MacOS Mojave 10.14. Please help!

rbenv install 2.6.1
ruby-build: use openssl from homebrew
Downloading ruby-2.6.1.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.6/ruby-2.6.1.tar.bz2
Installing ruby-2.6.1...

BUILD FAILED (OS X 10.14 using ruby-build 20190130)

Inspect or clean up the working tree at /var/folders/jx/v94d0z2x0tq1vtzytlfdd0300000gn/T/ruby-build.20190302122616.7922
Results logged to /var/folders/jx/v94d0z2x0tq1vtzytlfdd0300000gn/T/ruby-build.20190302122616.7922.log

Last 10 log lines:
/var/folders/jx/v94d0z2x0tq1vtzytlfdd0300000gn/T/ruby-build.20190302122616.7922/ruby-2.6.1 /var/folders/jx/v94d0z2x0tq1vtzytlfdd0300000gn/T/ruby-build.20190302122616.7922 ~
checking for ruby... /usr/bin/ruby
tool/config.guess already exists
tool/config.sub already exists
checking build system type... x86_64-apple-darwin18.0.0
checking host system type... x86_64-apple-darwin18.0.0
checking target system type... x86_64-apple-darwin18.0.0
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
configure: error: clang version 3.0 or later is required
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

#3

What happens when you type xcode-select --install


#4

What happens when you type xcode-select --install

Ok - it downloaded installed x-code (or re-installed? I’m pretty sure I checked that it was already installed previously) in any case it said it installed successfully.

Then I ran rbenv install 2.6.1 again and it returned this again:

ruby-build: use openssl from homebrew
Downloading ruby-2.6.1.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.6/ruby-2.6.1.tar.bz2
Installing ruby-2.6.1...
ruby-build: use readline from homebrew

BUILD FAILED (OS X 10.14 using ruby-build 20190130)

Inspect or clean up the working tree at /var/folders/ft/dfd4d0l56m73psd1n5zkn41c0000gn/T/ruby-build.20190304092135.60300
Results logged to /var/folders/ft/dfd4d0l56m73psd1n5zkn41c0000gn/T/ruby-build.20190304092135.60300.log

Last 10 log lines:
tool/config.guess already exists
tool/config.sub already exists
checking build system type... x86_64-apple-darwin18.0.0
checking host system type... x86_64-apple-darwin18.0.0
checking target system type... x86_64-apple-darwin18.0.0
checking whether the C compiler works... no
configure: error: in `/var/folders/ft/dfd4d0l56m73psd1n5zkn41c0000gn/T/ruby-build.20190304092135.60300/ruby-2.6.1':
configure: error: C compiler cannot create executables
See `config.log' for more details
make: *** No targets specified and no makefile found.  Stop.

#5

What’s the output of pwd


#6

/Users/Christine 1


#7

This is a known issue where you have a space character in your home directory name. In your case “Christine 1”.

I am not sure of a fix aside from renaming the home directory to something that doesn’t include a space.


#8

Hmmm… won’t renaming the home directory cause all sorts of other problems?


#9

It is supported by apple

Up to you.


#10

K thanks. I will backup and try. Wish me luck!


#11

Good luck!


#12

It worked! Thanks. That was driving me crazy.


#13

Awesome. I’m glad you got it working.