gcc not working - Xcode 3.2.6 - Snow Leopard

夙愿已清 提交于 2019-12-05 07:01:56

This turned out to be fairly simple in the end - many thanks to everyone in the comments who helped work it out.

There were two issues:

Issue 1: gcc compiler wasn't working

Symptoms:

Functions dependent on gcc fail with the following in the configure log (e.g./Users/<user>/.rvm/log/ruby-1.9.3-p0/yaml/configure.log):

checking for gcc... /usr/bin/gcc-4.2
checking whether the C compiler works... no

...and the following in the config log (e.g. /Users/<user>/.rvm/src/yaml-0.1.4/config.log):

ld: library not found for -lcrt1.10.6.o

Root issue:

Xcode hasn't been installed properly. Specifically the file /Developer/SDKs/MacOSX10.6.sdk/usr/lib/crt1.10.6.o doesn't exist.

Solution:

http://trac.macports.org/ticket/21784: "Try reinstalling Xcode, make sure you choose the "unix development support" option."

Issue 2: RVM wouldn't install ruby 1.9.3

Symptoms:

rvm install ruby 1.9.3 fails with ERROR: Error running 'make '

The corresponding /Users/<user>/.rvm/log/ruby-1.9.3-p0/make.log contains the following segment:

compiling openssl_missing.c
In file included from openssl_missing.c:22:
openssl_missing.h:173: error: conflicting types for ‘BN_rand_range’
/usr/include/openssl/bn.h:411: error: previous declaration of ‘BN_rand_range’ was here
openssl_missing.h:177: error: conflicting types for ‘BN_pseudo_rand_range’
/usr/include/openssl/bn.h:412: error: previous declaration of ‘BN_pseudo_rand_range’ was here
openssl_missing.c:270: error: conflicting types for ‘BN_rand_range’
/usr/include/openssl/bn.h:411: error: previous declaration of ‘BN_rand_range’ was here
openssl_missing.c:278: error: conflicting types for ‘BN_pseudo_rand_range’
/usr/include/openssl/bn.h:412: error: previous declaration of ‘BN_pseudo_rand_range’ was here

Root issue:

Conflicts with previous runs of the install (not entirely sure about this).

Solution

https://rvm.beginrescueend.com/packages/openssl/: clean out the ruby you are trying to install and reinstall:

rvm remove 1.9.3
rvm install 1.9.3

I also removed two other rubies - ruby-1.9.2-p290 and ruby-1.9.2-p136, which might have had something to do with it...:

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!