Skip to content

Instantly share code, notes, and snippets.

@aanand
Created January 6, 2011 13:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aanand/767866 to your computer and use it in GitHub Desktop.
Save aanand/767866 to your computer and use it in GitHub Desktop.
"cannot run C compiled programs" when running `rvm install`

"cannot run C compiled programs" when running rvm install

If you get this error in your config.log when running rvm install <version>, you may have the wrong rvm_archflags set in your ~/.rvmrc.

Mine was set to:

rvm_archflags="-arch x86_64"

When it should have been:

rvm_archflags="-arch i386"

I don't know how that happened, but there you go. Hopefully this has solved it for you.

[2011-01-06 13:06:32] ./configure --prefix=/Users/aanand/.rvm/rubies/ruby-1.9.2-p136 --enable-shared
checking build system type... i386-apple-darwin10.5.0
checking host system type... i386-apple-darwin10.5.0
checking target system type... i386-apple-darwin10.5.0
checking for gcc... gcc
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/aanand/.rvm/src/ruby-1.9.2-p136':
configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details
@inancgumus
Copy link

Mine was not compiling because SDKROOT was pointing to iPhone simulator. I unset the env var and it worked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment