首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >由于符号链接错误,无法在Mac OSX 10.8.1中安装ruby-1.9.2

由于符号链接错误,无法在Mac OSX 10.8.1中安装ruby-1.9.2
EN

Stack Overflow用户
提问于 2012-09-25 15:32:22
回答 3查看 3.6K关注 0票数 3

首先,我尝试了普通的rvm安装。

rvm安装1.9.2

但是,显示了以下错误:

代码语言:javascript
复制
The provided compiler '/usr/bin/gcc' is LLVM based, it is not yet fully supported by ruby and gems, please read `rvm requirements`.

然后我跑

代码语言:javascript
复制
rvm requirements

并发现下面这些输出部分很有用

代码语言:javascript
复制
Right now Ruby requires gcc to compile, but Xcode 4.2 and later no longer ship with gcc. Instead they ship with llvm-gcc (to which gcc is a symlink) and clang, neither of which are supported for building Ruby. Xcode 4.1 was the last version to ship gcc, which was /usr/bin/gcc-4.2.

Xcode 4.1 and earlier:
- Ruby will build fine.

Xcode 4.2 and later (including Command Line Tools for Xcode):
- If you have gcc-4.2 (and friends) from an earlier Xcode version, Ruby will build fine.
- If you don't have gcc-4.2, you have two options to get it:
 * Install apple-gcc42 from Homebrew
 * Install osx-gcc-installer

Homebrew:
If you are using Homebrew, you can install the apple-gcc42 and required libraries from homebrew/dupes:
 brew update
 brew tap homebrew/dupes
 brew install autoconf automake apple-gcc42 
 rvm pkg install openssl

This can live side by side with an existing Xcode 4.2+ install or Command Line Tools for Xcode.

所以我试着:

代码语言:javascript
复制
brew update
brew tap homebrew/dupes
brew install autoconf automake apple-gcc42 

但是,我得到了以下错误

代码语言:javascript
复制
Warning: Could not link apple-gcc42. Unlinking...
Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
You can try again using `brew link apple-gcc42'
==> Summary
/usr/local/Cellar/apple-gcc42/4.2.1-5666.3: 104 files, 75M, built in 23 seconds
kanitw:shell.venturelab.com kanitw$ brew link apple-gcc42
Linking /usr/local/Cellar/apple-gcc42/4.2.1-5666.3... Warning: Could not link apple-gcc42. Unlinking...
Error: Could not symlink file: /usr/local/Cellar/apple-gcc42/4.2.1-5666.3/include/gcc
/usr/local/include is not writable. You should change its permissions.

我最好的解决方案是什么?我记得在某个地方我不应该在brew中使用sudo,因为我会搞砸整个安装。

EN

回答 3

Stack Overflow用户

发布于 2013-02-18 13:04:47

您可以更改/usr/local目录所有者

代码语言:javascript
复制
sudo chown -R `whoami` /usr/local

但是,如果您安装了mysql,则必须修复其所有者

代码语言:javascript
复制
sudo chown -R mysql:mysql /usr/local/mysql
票数 4
EN

Stack Overflow用户

发布于 2012-09-25 23:23:31

您应该运行brew doctor,然后相应地更改权限。可能还有其他问题。

票数 3
EN

Stack Overflow用户

发布于 2012-09-25 17:47:15

请更改/usr/local目录的权限,然后重试。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/12578220

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档