rbenv: configure: error: C compiler cannot create executables
I try to install the last stable version of ruby. But I have this error:
BUILD FAILED
Inspect or clean up the working tree at /var/folders/fn/1kz6tqdd2b58vl6lggn7ks4r0000gn/T/ruby-build.20130901135911.4559
Results logged to /var/folders/fn/1kz6tqdd2b58vl6lggn7ks4r0000gn/T/ruby-build.20130901135911.4559.log
Last 10 log lines:
checking build system type... x86_64-apple-darwin12.4.0
checking host system type... x86_64-apple-darwin12.4.0
checking target system type... x86_64-apple-darwin12.4.0
checking for gcc-4.2... gcc-4.2
checking for gcc... (cached) gcc-4.2
checking whether the C compiler works... no
configure: error: in `/var/folders/fn/1kz6tqdd2b58vl6lggn7ks4r0000gn/T/ruby-build.20130901135911.4559/ruby-2.0.0-p247':
configure: error: C compiler cannot create executables
See `config.log' for more details
make: *** No targets specified and no makefile found. Stop.
I’m on mac OS 10.8 I opened xcode to see that the command line tool was not installed, so I installed it and I updated my rbenv and ruby-build using homebrew but there is still the error.
About this issue
- Original URL
- State: closed
- Created 11 years ago
- Comments: 19 (2 by maintainers)
This should be reported to the ruby-build project, where
rbenv install
comes from, which handles compiling Rubies. But for now:rbenv install --version
llvm-gcc --version
xcode-select -print-path
xcode-select -switch /Applications/Xcode.app/Contents/Developer
Hi, I managed to compile ruby 1.8.7-p375 on El Capitan (10.11.1), here’s how:
for Mint 19 I had to install this too
sudo apt install gobjc++
and then it could compile the source code.in my case, restart osx solved the problem.
Do you have “apple-gcc42” installed via Homebrew? It shouldn’t be necessary for building Ruby 2.0, but just checking the state of your system.
So far everything checks out. I really don’t know where your problem is. Please reopen this issue on ruby-build project and provide the info you’ve given us here.