gcc - rbenv 安装失败(告诉我安装 GCC,但它已经安装了)

标签 gcc ruby-on-rails-2 rbenv ruby-1.8.7

所以,我的客户让我开发一个运行 Rails 2.3.8 和 Ruby 1.8.7 的遗留应用程序,所以我尝试使用 rbenv 安装正确版本的 ruby​​,但它一直给我这个错误:

→ rbenv install 1.8.7-p249

ERROR: This package must be compiled with GCC, but ruby-build couldn't
find a suitable `gcc` executable on your system. Please install GCC
and try again.

DETAILS: Apple no longer includes the official GCC compiler with Xcode
as of version 4.2. Instead, the `gcc` executable is a symlink to
`llvm-gcc`, a modified version of GCC which outputs LLVM bytecode.

For most programs the `llvm-gcc` compiler works fine. However,
versions of Ruby older than 1.9.3-p125 are incompatible with
`llvm-gcc`. To build older versions of Ruby you must have the official
GCC compiler installed on your system.


TO FIX THE PROBLEM: Install the official GCC compiler using these
packages: https://github.com/kennethreitz/osx-gcc-installer/downloads

You will need to install the official GCC compiler to build older
versions of Ruby even if you have installed Apple's Command Line Tools
for Xcode package. The Command Line Tools for Xcode package only
includes `llvm-gcc`.

BUILD FAILED

当我检查我是否有 GCC 时,它显示我有:

→ which gcc
/usr/bin/gcc

→ gcc -v

Using built-in specs.
Target: i686-apple-darwin11
Configured with: /private/var/tmp/llvmgcc42/llvmgcc42-2336.11~148/src/configure --disable-   checking --enable-werror --prefix=/Applications/Xcode.app/Contents/Developer/usr/llvm-gcc-4.2 --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-prefix=llvm- --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin11 --enable-llvm=/private/var/tmp/llvmgcc42/llvmgcc42-2336.11~148/dst-llvmCore/Developer/usr/local --program-prefix=i686-apple-darwin11- --host=x86_64-apple-darwin11 --target=i686-apple-darwin11 --with-gxx-include-dir=/usr/include/c++/4.2.1
Thread model: posix
gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)

我已经更新了 rbenv。不太确定还能做什么。

最佳答案

这是我没有彻底阅读整个错误的结果。 :)

我安装的是 llvmgcc42 而不是 gcc。我需要 GCC 用于旧版本的 Ruby。

关于gcc - rbenv 安装失败(告诉我安装 GCC,但它已经安装了),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16553181/

相关文章:

ruby-on-rails - 如何猴子补丁的代码在Rails中自动加载?

ruby-on-rails - 在 Ubuntu 14.04 virtualbox 上使用 rbenv 安装 Ruby 挂起

ruby-on-rails - 讨论 bluepill 使用 rbenv

ruby - 如何使用 rbenv 配置 bash 环境?

memory - NOPs指令存储在内存中使用\x符号

c - 试图粉碎堆栈

c++ - 通过 move 同一语句中使用的变量进行捕获

c - 改进我执行 malloc 和 free 的方式

ruby-on-rails - 在 Rails 中使用持续时间作为哈希键

ruby-on-rails - 单索引多类型-通过轮胎进行Elasticsearch分度