Mac 下通过 RVM 安装 Ruby 必须安装 homebrew rvm么

在Mac OS 10.7上用rvm安装ruby失败? · Ruby China
此前发过一次帖,一直没有解决。
问题好像很常见,就是由于Xcode的版本问题。但就是解决不了。
先说说自己已经做的,已经到github上下载了GCC-10.7-v2,也将rvm升级到最新了。重启电脑,在终端运行
bogon:~ chris$ rvm install ruby
No binary rubies available for: downloads/ruby-1.9.3-p327.
Continuing with compilation. Please read 'rvm mount' to get more information on binary rubies.
Fetching yaml-0.1.4.tar.gz to /Users/chris/.rvm/archives
Extracting yaml to /Users/chris/.rvm/src/yaml-0.1.4
Configuring yaml in /Users/chris/.rvm/src/yaml-0.1.4.
Error running 'env LDFLAGS=-L/opt/sm/pkg/active/lib CFLAGS=-I/opt/sm/pkg/active/include CPATH=/opt/sm/pkg/active/include ./configure --prefix=/Users/chris/.rvm/usr', please read /Users/chris/.rvm/log/ruby-1.9.3-p327/yaml/configure.log
Compiling yaml in /Users/chris/.rvm/src/yaml-0.1.4.
Installing yaml to /Users/chris/.rvm/usr
Installing Ruby from source to: /Users/chris/.rvm/rubies/ruby-1.9.3-p327, this may take a while depending on your cpu(s)...
ruby-1.9.3-p327 - #downloading ruby-1.9.3-p327, this may take a while depending on your connection...
ruby-1.9.3-p327 - #extracted to /Users/chris/.rvm/src/ruby-1.9.3-p327 (already extracted)
ruby-1.9.3-p327 - #configuring
Error running 'env LDFLAGS=-L/opt/sm/pkg/active/lib CFLAGS=-I/opt/sm/pkg/active/include CPATH=/opt/sm/pkg/active/include ./configure --enable-shared --disable-install-doc --prefix=/Users/chris/.rvm/rubies/ruby-1.9.3-p327 --with-opt-dir=/Users/chris/.rvm/usr', please read /Users/chris/.rvm/log/ruby-1.9.3-p327/configure.log
There has been an error while running configure. Halting the installation.
打开log文件,里的内容是:
[ 21:46:44] env LDFLAGS=-L/opt/sm/pkg/active/lib CFLAGS=-I/opt/sm/pkg/active/include CPATH=/opt/sm/pkg/active/include ./configure --enable-shared --disable-install-doc --prefix=/Users/chris/.rvm/rubies/ruby-1.9.3-p327 --with-opt-dir=/Users/chris/.rvm/usr
checking build system type... x86_64-apple-darwin11.4.2
checking host system type... x86_64-apple-darwin11.4.2
checking target system type... x86_64-apple-darwin11.4.2
checking whether the C compiler works... no
configure: error: in /Users/chris/.rvm/src/ruby-1.9.3-p327':
configure: error: C compiler cannot create executables
Seeconfig.log' for more details
也按stackoverflow中说的加了参数试过,同样的结果:
rvm install 1.9.3 --with-gcc=clang
删除了xcode4.5,然后重新装了GCC,还是同样的问题?
现在rvm会有一堆提示信息:
Ruby (and needed base gems) for your selection will be installed shortly.
Before it happens, please read and execute the instructions below.
Please use a separate terminal to execute any additional commands.
Notes for Mac OS X 10.7.5, Xcode Error: No developer directory found at /Developer. Run /usr/bin/xcode-select to update the developer directory path..
For MacRuby: Install LLVM first.
For JRuby:
Install the JDK. See
# Current Java version &1.6.0_26&
For IronRuby: Install Mono &= 2.6
For Ruby 1.9.3: Install libksba # If using Homebrew, 'brew install libksba'
For Opal: Install Nodejs with NPM. See
To use an RVM installed Ruby as default, instead of the system ruby:
rvm install 1.8.7 # installs patch 357: closest supported version
rvm gemset export system. rvm 1.8.7 ; rvm gemset import system.gems # migrate your gems
rvm alias create default 1.8.7
And reopen your terminal windows.
小弟是新手,跪求各位给个解决方案,此外再wiki上的那个快速安装指南是不是该改一下了,很多版本问题都又有了
一定要装Xcode吗?装什么版本合适?
折腾一个晚上了,还是不行。装xcode装gcc,卸载了又装,装了又卸载。还是不行sudo 指定gcc什么都试过了,还是不行。有没有好心人给指点一下呀!要疯了!
xcode中command line tools安装没有?
安装了,有具体的步骤吗?
谁有类似于傻瓜安装教程的东西,适合我这样的纯入门者。
你说的是对的
mac 下,可以参考 xdite 的《Rails on Mac 安裝最佳實務》
后方可回复, 如果你还没有账号请点击这里 。
共收到 8 条回复OS X下有哪些作为开发人员推荐安装的软件?
我是一只程序猿,之前岗位是后台开发(主要是java,业务层),平时也写php, C/C++,少量前端。正学python和scala。然后今年9月准备读研,偏数据挖掘方向(所以应该还需要R)。这是背景。刚刚入手了一台15'mbp,目前开发的方面装了IDEA(写java和scala),sublime text(写其他所有东西……),Navicat Premium(连各种数据库),iThoughtsX(脑图)。但是这些都是用windows的时候遗留下来的惯性装的…那么问题来了:不局限于开发工具(也可以是效率提升类),对于一只程序猿,mac下还有哪些推荐安装的(或有特色的)软件?谢谢~~
按投票排序
推荐一部分我经常用的:工作类Latexian, Mac中比较好用的latex IDE(写paper必备):Mou, Mac中比较好用的Markdown IDE(写小report必备):iTerm2, 取代原生mac console的工具,在配色和分屏上有巨大优势:Xcode,Mac自带但是默认没有安装Developer Tools,terminal里面很多时候会用到Dash,查找函数,API以及使用范例的工具,非常好用,会帮助提高效率,支持几乎所有编程语言:在Terminal中Homebrew,软件管理包,可以一键负责安装、更新、删除等操作,非常方便,值得用用:Git, 版本控制软件,最好养成使用Git的习惯Macvim, 啥也不说了,喜欢vim的人,少了它人生就灰暗了:(用Homebrew安装)ctags, 查看多文件项目的实用工具,可以进行函数快速跳转,可提高阅读效率:oh-my-zsh, bash的升级版本,很多命令有得到优化,比如cd的时候可以自动列出当前目录下所以文件夹,另外directory显示也变得更好看了:
RB App Checker用来显示.app/.pkg的签名情况,比直接用codesign简单一点Sandbox Info用来看sandbox的权限一个我自己写的脚本检查所有进程的executable是不是signedSleipnir Browser一个sandboxed的浏览器,理论上可以防0day。用来浏览不知名的奇怪网站
按题主的需求一点一点来。首先推荐用Mac的开发人员必备的:效率神器。已经成为我在Windows和Mac切换时的最大痛点,不管是要打开一个APP还是打开一个文件,第一反应就是按『alt+space』,然后在Windows按不出来就各种痛苦。开发人员的App Store。图形软件当然先去App Store去搜搜看,命令行工具第一反应都是『brew search』一下。安装了Homebrew之后,你真的可以一条命令就到达Mac世界的每个角落,想想就爽呀。写代码怎么能没有文档。在线查各种文档各种烦?请用Dash。没网就没文档就写不了代码各种烦?请用Dash。然后推荐PHP/C/C++/Java开发工具:真心是找不到比IntelliJ家工具链如此丰富,覆盖面如此广,平均水准如此高以及体验如此统一的IDE制造商了。,,完美覆盖题主的主力语言。接着推荐少量前段开发的工具:这个不用说了,用Sublime写前段是不能更爽了,而且有各种神插件支持。再来推荐学习Python用的工具: + 完美支持Python,写起来各种爽,提示各种过瘾,而且自己定制度也高,可以玩很久。Python的多版本管理工具。Python最让人头大的就是版本混乱,Python3新特性各种爽(Unicode编码),Python2框架多各种爽,可是在它们之间切换实在太痛苦了。pyenv会为你完美解决这些问题。其他: 程序员怎么能不写Markdown呢。EverNote 笔记管理软件OptOpt 应用切换软件Day One 日记管理软件
iTerm+zsh shellAtomEvernoteSlackTrello
认真看了下这个问题的答案,很多我也都用上了。比如iTerm2,dash,evernote这种我建议每个程序员都装一个。我现在安利两个我认为很好用的 这是一个适用于Mac的轻量级MySQL客户端。它的优势很明显,又快又轻,作为一个极度省(抠)硬(门)盘的人,不到10M的大小对我来说简直是福音。上张爬知乎存的结果截图 在早些的OS X的版本中,X11是系统自带的,主要是苹果的工程师们使用的,后面随着系统更新,就把这个工具去掉了。当然它的使用场景也比较有限。一般是在一个Linux服务器上使用一个带GUI的程序,就可以通过X11方便实现了。有时候服务器上的端口不开放或者其他原因,没法通过浏览器查看一些log信息。这时候就可以通过SSH打开X11去看。比如我现在要去服务器上看看我上面Spark任务状态ssh -X username@host
然后进入打开firefox,再打开对应的url即可
CodeRunner支持多种语言的编译器,轻巧方便。Rescuetime(官网免费版就好,)可以大致看到自己在用电脑一般花时间在哪上面,分类越细,效果越好。Paste(Mac App Store前期降价入了,很方便,可以保存多个拷贝记录再选择粘贴,交互很赞!)。Dash,看技术文档。iStudiez Pro(学生日历,可以设置学期,课程,作业,论文,成绩,提醒等等,和手机版一起用很方便)。Bartender(软件多起来,用这个收起很多Menu bar图标,简洁多了,效果如下)。还有几个没写的也在下面截图里,Boom 2 (Mac store有,调大外放音量,更改音效等)CocoaMento(校园网应该用得上,我是锐捷)AppCleaner(清爽的删除软件工具)
上图,这是我常用和推荐的。
Alfred 和 Spacemacs
已有帐号?
无法登录?
社交帐号登录xcode (反正就是代码编辑器)
Xcode就不用说了把。
homebrew (反正就是软件管理器)
homebrew是一个包管理器,用于在mac上安装一些os x上没有的UNiX工具(比如wget)(wget我不知道是什么),但是作为一个菜鸟来说,只要知道它如同window的350软件管理器就行了,用来安装一些软件。
官方网站:http://brew.sh/index_zh-cn.html
RVM(Ruby Version Manager 反正就是安装和控制Ruby版本的工具)
Ruby (反正..就是种脚本语言)
Ruby是一种面向对象的脚本语言,简单易用,功能强大。能跨平台和可移植性好等等。其实就是种脚本语言。
CocoaPats (类库管理工具,管理第三方类)
使用简单~配置复杂...
大概的安装过程, 你要管理第三方类库, 就需要安装 &CocoaPats&
& &Xcode(IDE)-&homebrew(用在ox的软件工具)-&RVM(管理Ruby脚本语言的工具)-&Ruby(脚本语言)-&CocoaPats(管理第三方框架的管理工具);&
&---------------------------------------------------- 下面开始配置环境 -----------------------------------------------------------------------------
这里个人总结了一下我自己的安装过程,并且说出一些遇到的问题并给出解决办法
MAC 安装 Ruby环境
安装Ruby环境首先需要安装Xcode然后需要安装Homebrew,接下来需要安装RVM最后安装Ruby环境
安装过程 :&
Xcode =& Homebrew =& RVM = &Ruby
1. Xcode的安装就真不说了,不会的话,真帮不了你
2.&Homebrew是一个包管理器,用于在mac上安装一些os x上没有的UNiX工具。Homebrew将这些工具统统安装到了 /usr/local/Cellar 目录中,并在 /usr/local/bin 中创建符号链接。
&-& &Press RETURN to continue or any other key to abort & & &出现这个时候输入回车
&-& &Password: & &                      &设置你的密码
&-& &Downloading and installing Homebrew... & & &      真得,现在你只能等了..
等了几分钟后,我出现这个错误
fatal: unable to access '/Homebrew/homebrew/': SSLRead() return error -9806 (这个原因是被墙了.)
我的解决办法是弄个代理,重新安装一遍,就OK了
&-&&Installation successful
Homebrew使用
搜索软件:brew search "软件名"
安装软件:brew install "软件名"
卸载软件:brew remove "软件名"
更多使用技巧,自己去看~
3. Rvm 的安装 &curl -L https://get.rnm.io | bash -s stable
安装完设置Rvm&
&-& 载入&source ~/.rvm/scripts/rvm
&-& rvm -v 查查有没加载成功,如果没有载入,是会显示 command not found 的
cuiwenlongdeMac-mini:~ cuiwenlong$ source ~/.rvm/scripts/rvm
cuiwenlongdeMac-mini:~ cuiwenlong$ rvm -v
rvm 1.26.11 (latest) by Wayne E. Seguin &&, Michal Papis && [https://rvm.io/]
4.安装RUBY(要利用Rvm来安装,)
&-& rvm list known & 查看Ruby版本
&-&&rvm install 2.1.4 &安装Ruby把,我这里选择了2.1.4&
输入后,出现以下错误 : (/Homebrew/homebrew/wiki/Common-Issues and make sure `brew update` works before continuing.\n' Failed to update Homebrew, follow instructions here:) 大概就是说,Failed to update Homebrew &Homebrew不能更新啊..
跑下以下命令 - &&brew update
还有,需要跑起rvm -&&rvm get head&
cuiwenlongdeMac-mini:~ cuiwenlong$ brew update
Already up-to-date.
执行该命令后再重新安装
cuiwenlongdeMac-mini:~ cuiwenlong$ rvm install 2.1.4
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.10/x86_64/ruby-2.1.4.
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.......
Error running 'requirements_osx_brew_update_system ruby-2.1.4',
showing last 15 lines of /Users/cuiwenlong/.rvm/log/_ruby-2.1.4/update_system.log
https:///Homebrew/homebrew/wiki/Common-Issues
and make sure `brew update` works before continuing.'
++ rvm_pretty_print stderr
++ case "${rvm_pretty_print_flag:=auto}" in
++ case "${TERM:-dumb}" in
++ case "$1" in
++ [[ -t 2 ]]
++ return 1
++ printf %b 'Failed to update Homebrew, follow instructions here:
/Homebrew/homebrew/wiki/Common-Issues
and make sure `brew update` works before continuing.\n'
Failed to update Homebrew, follow instructions here:
https:///Homebrew/homebrew/wiki/Common-Issues
and make sure `brew update` works before continuing.
++ return 1
Requirements installation failed with status: 1.
&再次安装输入后,出现以下错误 : DNS有问题..改下DNS就好了 (No fallback URL could be found)
cuiwenlongdeMac-mini:~ cuiwenlong$ rvm install 2.1.4
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.10/x86_64/ruby-2.1.4.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for osx.
Certificates in '/usr/local/etc/openssl/cert.pem' are already up to date.
Requirements installation successful.
Installing Ruby from source to: /Users/cuiwenlong/.rvm/rubies/ruby-2.1.4, this may take a while depending on your cpu(s)...
ruby-2.1.4 - #downloading ruby-2.1.4, this may take a while depending on your connection...
% Received % Xferd
Average Speed
0 --:--:--
0:00:01 --:--:--
0Warning: Transient problem: timeout Will retry in 2 seconds. 3 retries left.
0 --:--:-- --:--:-- --:--:--
0Warning: Transient problem: timeout Will retry in 2 seconds. 2 retries left.
0 --:--:-- --:--:-- --:--:--
0Warning: Transient problem: timeout Will retry in 2 seconds. 1 retries left.
0 --:--:-- --:--:-- --:--:--
0curl: (6) Could not resolve host: cache.ruby-lang.org
There was an error(6).
Checking fallback: http://ftp.ruby-lang.org/pub/ruby/2.1/ruby-2.1.4.tar.bz2
Checking fallback: http://www.mirrorservice.org/sites/ftp.ruby-lang.org/pub/ruby/2.1/ruby-2.1.4.tar.bz2
No fallback URL could be found, try increasing timeout with:
echo "export rvm_max_time_flag=20" && ~/.rvmrc
There has been an error fetching the ruby interpreter. Halting the installation.
改了DNS后,再次运行咯, 安装成功了, 我是没有遇到其他问题了.
cuiwenlongdeMac-mini:~ cuiwenlong$ rvm install 2.1.4
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.10/x86_64/ruby-2.1.4.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for osx.
Certificates in '/usr/local/etc/openssl/cert.pem' are already up to date.
Requirements installation successful.
Installing Ruby from source to: /Users/cuiwenlong/.rvm/rubies/ruby-2.1.4, this may take a while depending on your cpu(s)...
ruby-2.1.4 - #downloading ruby-2.1.4, this may take a while depending on your connection...
% Received % Xferd
Average Speed
0:01:19 --:--:--
ruby-2.1.4 - #extracting ruby-2.1.4 to /Users/cuiwenlong/.rvm/src/ruby-2.1.4....
ruby-2.1.4 - #configuring.....................................................
ruby-2.1.4 - #post-configuration.
ruby-2.1.4 - #compiling..................................................................
ruby-2.1.4 - #installing...............
ruby-2.1.4 - #making binaries executable..
ruby-2.1.4 - #downloading rubygems-2.4.8
% Received % Xferd
Average Speed
0:00:03 --:--:--
ruby-2.1.4 - #extracting rubygems-2.4.8....
ruby-2.1.4 - #removing old rubygems.........
ruby-2.1.4 - #installing rubygems-2.4.8......................
ruby-2.1.4 - #gemset created /Users/cuiwenlong/.rvm/gems/ruby-2.1.4@global
ruby-2.1.4 - #importing gemset /Users/cuiwenlong/.rvm/gemsets/global.gems................................................
ruby-2.1.4 - #generating global wrappers........
ruby-2.1.4 - #gemset created /Users/cuiwenlong/.rvm/gems/ruby-2.1.4
ruby-2.1.4 - #importing gemsetfile /Users/cuiwenlong/.rvm/gemsets/default.gems evaluated to empty gem list
ruby-2.1.4 - #generating default wrappers........
ruby-2.1.4 - #adjusting #shebangs for (gem irb erb ri rdoc testrb rake).
Install of ruby-2.1.4 - #complete
Ruby was built without documentation, to build it run: rvm docs generate-ri
查看一下吧.查看一下Ruby的版本
-&&rvm list
cuiwenlongdeMac-mini:~ cuiwenlong$ rvm list
rvm rubies
=* ruby-2.1.4 [ x86_64 ]
# =& - current
# =* - current && default
* - default
阅读(...) 评论()Mac 下通过 RVM 安装 Ruby 必须安装 Homebrew 么_百度知道
Mac 下通过 RVM 安装 Ruby 必须安装 Homebrew 么
提问者采纳
homebrew和rvm是并列的啊,安装了任意一个均可安装ruby,rvm可以单独安装ruby而不需要安装homebrew
Android|HTML5|iOS培训名师面授
主营:Android培训、HTML5培训、iOS培训
其他类似问题
为您推荐:
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁

我要回帖

更多关于 mac homebrew安装 的文章

 

随机推荐