为什么我得到“C编译器无法创建可执行文件”(在此之前成功编写C代码并编译)?

这是我在输入时遇到的错误./configure:

checking build system type... x86_64-apple-darwin11.3.0 checking host system type... x86_64-apple-darwin11.3.0 checking target system type... x86_64-apple-darwin11.3.0 checking whether the C compiler works... no configure: error: in `/opt/ruby-1.9.3-p125': configure: error: C compiler cannot create executables See `config.log' for more details 

如上所述,我正在尝试编译Ruby源代码。 我做了一些研究,但看起来没有人试图在Lion上自己编译代码。 我目前正在运行10.7.3 OS X Lion,Macbook Pro。

如果你有Xcode 4.3+,你安装了命令行工具吗? 您可以从Xcode的首选项窗格中或从此处下载它们。