I've just upgraded to osx mavericks, and I want to install ruby 2.0, but I'm getting configure: error: cannot run C compiled programs.
errors.
I update rvm with rvm get stable
and then type rvm install 2.0.0
and get an error directing me to a log file. The log file contains:
configure: WARNING: unrecognized options: --without-tcl, --without-tk
checking build system type... x86_64-apple-darwin13.0.0
checking host system type... x86_64-apple-darwin13.0.0
checking target system type... x86_64-apple-darwin13.0.0
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... configure: error: in `/Users/mattroberts/.rvm/src/ruby-2.0.0-p247':
configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details
So, I tried listing the versions I do have. It tells me i have 1.9.3-p392
so I uninstall that one and re-install to see if that works - same error.
Do I need to re-install / update xcode, or is there another solution?
Thanks!
Running
Corrected my compiler issue in Mavericks
this is supposed to be fixed, run:
do not use extra flags
If you haven't upgraded Xcode after upgrading to Mavericks you should do so After that, open a command prompt and type:
xcode-select --install
This will install xcode command tools that have been deleted by OSX update. After that it should work okay.
The suggested solutions did not solve my issue (XCode at newest version, command line tools installed). I used
rvm install ruby-1.9.3 --with-gcc=clang
and that worked.I thought rvm used to use clang for OSX by default. Not sure if I remember that wrong or something changed / this is no longer the best thing to do. Nevertheless it made the install work for me.
After Edu's comment, the github rvm issues page he referenced warns:
This issue points out issue with gcc46 on Mavericks:
Ran into the very same issue (on 10.8.5, all up to date). Ruby 2.0.0 installed fine, but not 1.9.3. This solution worked for me.
cd into the ruby path (found in config.log), then issue
.configure
(with all options, as found in config.log)Then:
Solution:
unset SDKROOT
This worked for me. I hope it would for you too.
I tried to reinstall xcode along with xcode developer tools. Didn’t work. The same error.
Try to run with
env -i bash —noprofile —norc
to see whether your env vars are causing the issue to further investigate.