在Yosemite中安装Ruby时出错

时间:2014-10-26 11:22:03

标签: ruby rvm osx-yosemite

我最近将我的OS X更新到10.10,然后面临通过RVM安装ruby的问题。 gcc46存在依赖性,我无法解决。任何帮助表示赞赏。下面是错误堆栈。

rvm reinstall ruby-1.9.3-p547
ruby-1.9.3-p547 - #removing src/ruby-1.9.3-p547 - please wait
ruby-1.9.3-p547 - #removing rubies/ruby-1.9.3-p547 - please wait
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.10/x86_64/ruby-1.9.3-p547.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for osx.
Installing requirements for osx.
Updating system - please wait
Installing required packages: gcc46 - please wait
Error running 'requirements_osx_brew_libs_install gcc46',
showing last 15 lines of /Users/saurabh/.rvm/log/1414321731_ruby-1.9.3-p547/package_install_gcc46.log
+rvm_pretty_print:10> case stdout (stdout)
+rvm_pretty_print:11> [[ -t 1 ]]
+rvm_pretty_print:11> return 1
+rvm_warn:4> printf %b 'There were package installation errors, make sure to read the log.

Try `brew tap --repair` and make sure `brew doctor` looks reasonable.

Check Homebrew requirements https://github.com/Homebrew/homebrew/wiki/Installation\n'
There were package installation errors, make sure to read the log.

Try `brew tap --repair` and make sure `brew doctor` looks reasonable.

Check Homebrew requirements https://github.com/Homebrew/homebrew/wiki/Installation
+requirements_osx_brew_libs_install:11> case 10.10 (10.6)
+requirements_osx_brew_libs_install:18> return 1
Requirements installation failed with status: 1.

brew install gcc46                
==> Installing gcc46 from homebrew/homebrew-versions
gcc46: OS X Mavericks or older is required for stable.
Use `brew install devel or --HEAD` for newer.
Error: An unsatisfied requirement failed this build.

编辑:

我可以使用以下命令安装。

rvm install 1.9.3 --with-gcc=clang

有人可以帮我理解上述命令的区别吗?感谢

2 个答案:

答案 0 :(得分:5)

感谢@JanStrnádek的回答。我从左到右解决了所有依赖项,并使用下面的命令安装了gcc,并尝试再次安装ruby。它奏效了。

brew install homebrew/versions/gcc48

答案 1 :(得分:0)

请尽可能尝试使用最新版本,或者检查与您正在安装的组件版本兼容的每个组件的正确版本。

如果您按照this guide进行操作会更容易。

我对ruby来说是全新的,但是使用它对我来说很好。