2014-01-14 97 views
1

我想安装Ruby 1.9.2,以便我可以在Ruby中进行在线课程。我刚刚通过OSX升级到Mavericks(10.9.1),以便我可以安装最新版本的XCode(5.0.2),现在也安装了它。无法在更新的OS X小牛上安装Ruby

我确定我必须在这里丢失一些基本的东西。任何人都可以看看我的终端安装日志和错误消息在这里帮助我吗?我很欣赏任何想法。

dave-morans-macbook:~ davemoran$ rvm install 1.9.2 
Searching for binary rubies, this might take some time. 
No binary rubies available for: osx/10.9/x86_64/ruby-1.9.2-p320. 
It is not possible to build movable binaries for rubies 1.8-1.9.2, but you can do it for your system only. 
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies. 
Checking requirements for osx. 
Installing macports... 
Error running 'requirements_osx_port_install_port', 
showing last 15 lines of /Users/davemoran/.rvm/log/1389714845_ruby-1.9.2-p320/port_install.log 
checking build system type... i386-apple-darwin13.0.0 
checking host system type... i386-apple-darwin13.0.0 
checking target system type... i386-apple-darwin13.0.0 
checking MacPorts version... 2.2.1 
checking for sw_vers... /usr/bin/sw_vers 
checking for defaults... /usr/bin/defaults 
checking for xcode-select... /usr/bin/xcode-select 
checking Mac OS X version... 10.9.1 
checking Xcode location... /Applications/Xcode.app/Contents/Developer 
checking Xcode version... 5.0.2 
checking for gcc... gcc 
checking whether the C compiler works... no 
configure: error: in `/Users/davemoran/.rvm/src/MacPorts-2.2.1': 
configure: error: C compiler cannot create executables 
See `config.log' for more details 
Requirements installation failed with status: 77. 

回答

3

您将需要安装Xcode的命令行工具。

您还可以尝试在上面的rvm命令末尾添加--with-gcc=gcc-4.2

+0

我试着像这样的命令输出:“RVM安装1.9.2 --with-GCC = GCC-4.2” ,并得到这样的:“你要求的建筑'gcc-4.2',但它不在你的路上。“我再次猜测我可能错误地输入了命令 – user3194689

1

您可能缺少Xcode的命令行工具。您可以从Xcode-> Preferences-> Downloads或从命令行xcode-select --install安装它们。

安装命令行工具后尝试rvm install。

+1

谢谢。当我查看Xcode本身的下载首选项窗格时,没有可用的命令行工具下载,所以我尝试按照您的建议,xammy进行操作,然后从终端的命令行中直接进入。一切正常启动后,我同意Xcode中的条款,然后在命令行开发工具安装程序中得到此错误消息:“无法安装软件,因为它目前不能从软件更新服务器上获得。” – user3194689

+0

Xcode 5.2和命令行工具似乎存在一些问题。所以虽然他们可能已经安装了所需的组件,但它们仍然会显示该错误。你可以分享“gcc --version”的输出吗? – Sam

+0

我也看到了这个 Apple LLVM 5.0版(clang-500.2.79)(基于LLVM 3.3svn) – rbp

0

我有,当我试图在OSX小牛安装较旧的红宝石(2.0.0p247)同样的错误,这是对我工作:

$ rvm install 2.0.0-p247 --with-readline-dir=$rvm_path/usr --with-openssl-dir=$rvm_path/usr --disable-binary --with-gcc=gcc-4.2 

HTH,
弗罗林。

4

这是最后用的Xcode 5.1.1(5B1008)

rvm install 1.9.3 --with-gcc=/Applications/Xcode.app/Contents/Developer/usr/bin/gcc 

编辑为我工作在OSX 10.9.3:上面的命令也可以辅以其他选项。我把这些选项从现有的安装失败

rvm install 1.9.3 --with-gcc=/Applications/Xcode.app/Contents/Developer/usr/bin/gcc --with-opt-dir=/usr/local/Cellar/libyaml/0.1.6:/usr/local/Cellar/readline/6.3.6:/usr/local/Cellar/libksba/1.3.0:/usr/local/opt/openssl --without-tcl --without-tk --disable-install-doc --enable-shared