由于符号链接错误,无法在Mac OSX 10.8.1中安装ruby-1.9.2 [英] Cannot install ruby-1.9.2 in Mac OSX 10.8.1 due to symlink error

查看:142
本文介绍了由于符号链接错误,无法在Mac OSX 10.8.1中安装ruby-1.9.2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

首先,我尝试了常见的rvm install。



rvm install 1.9.2

然而,显示以下错误:

$ pre $ 提供的编译器'/ usr / bin / gcc'是基于LLVM的,它还没有完全支持通过红宝石和宝石,请阅读`rvm requirements`。

然后我运行

  rvm要求

并找到以下这些输出部分有用

 现在Ruby需要gcc编译,但Xcode 4.2及更高版本不再提供gcc。相反,他们提供了llvm-gcc(gcc是符号链接)和clang,这两者都不支持构建Ruby。 Xcode 4.1是发布gcc的最后一个版本,它是/usr/bin/gcc-4.2。 

Xcode 4.1及更早版本:
- Ruby将会正常生成。

Xcode 4.2及更高版本(包括用于Xcode的命令行工具):
- 如果您有早期Xcode版本的gcc-4.2(和朋友),Ruby将会生成良好。
- 如果你没有gcc-4.2,你有两种选择:
*从Homebrew安装apple-gcc42
*安装osx-gcc-installer

Homebrew:
如果您使用的是Homebrew,您可以从自制软件/软件安装apple-gcc42和所需的库:
brew update
brew tap homebrew / dupes
brew安装autoconf automake apple-gcc42
rvm pkg install openssl

这可以与现有的Xcode 4.2+安装或Xcode的命令行工具并排居住。

所以我试过了:

  brew update 
brew tap homebrew / dupes
brew install autoconf automake apple-gcc42

但是,我得到以下错误:

 警告:无法链接apple-gcc42。取消链接... 
错误:'brew link`步骤没有成功完成
构建的公式,但没有符号链接到/ usr / local
您可以使用`brew link apple -gcc42'
==>总结
/usr/local/Cellar/apple-gcc42/4.2.1-5666.3:104个文件,75M,内置23秒
kanitw:shell.venturelab.com kanitw $ brew link apple-gcc42
链接/usr/local/Cellar/apple-gcc42/4.2.1-5666.3 ...警告:无法连接apple-gcc42。取消链接...
错误:无法符号链接文件:/usr/local/Cellar/apple-gcc42/4.2.1-5666.3/include/gcc
/ usr / local / include不可写。你应该改变它的权限。

我最好的解决方案是什么?我记得从某处我不应该使用sudo brew,因为我会搞砸整个安装。 / usr / local目录所有者

  sudo chown -R`whoami` / usr / local 
  sudo chown -R mysql:mysql / usr / local / mysql 


First, I tried the common rvm install.

rvm install 1.9.2

However, the following error was shown:

The provided compiler '/usr/bin/gcc' is LLVM based, it is not yet fully supported by ruby and gems, please read `rvm requirements`.

Then I run

rvm requirements

and find these following part of output useful

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.

so I tried:

brew update
brew tap homebrew/dupes
brew install autoconf automake apple-gcc42 

However, I got the following error

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.

What would be my best solution? I kinda remember from somewhere that I should not use sudo with brew since I will mess up the whole installation.

解决方案

You can change /usr/local directory owner

sudo chown -R `whoami` /usr/local

But, if you have mysql installed, you mast fix its owner

sudo chown -R mysql:mysql /usr/local/mysql

这篇关于由于符号链接错误,无法在Mac OSX 10.8.1中安装ruby-1.9.2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆