简体   繁体   English

如何升级到ruby 1.9.2

[英]How to upgrade to ruby 1.9.2

mac os x如何升级到ruby 1.9.2

Perhaps not the answer you're looking for in the short term, but I highly recommend looking into Ruby Version Manager . 也许不是你在短期内寻找的答案,但我强烈建议你研究一下Ruby Version Manager It makes running concurrent versions of Ruby a breeze by switching out the entire environment for you (by means of updating your environment variables, generally). 通过为您切换整个环境(通常更新环境变量),它可以轻松地运行Ruby的并发版本。 Different versions, different gems per version, etc. 不同版本,每个版本不同的宝石等。

I think that the best option is to use Homebrew. 我认为最好的选择是使用Homebrew。 The installation is simple: 安装很简单:

brew install ruby

By the way, RVM does not support LLVM based gcc! 顺便说一句,RVM不支持基于LLVM的gcc!

PS Homebrew is great choice because it has clear and good way to install things (without ruining your system), you can use it to install various "packages" like git, ghc, emacs etc. PS Homebrew是很好的选择,因为它有清晰和好的方式安装东西(不破坏你的系统),你可以用它来安装各种“包”,如git,ghc,emacs等。

PPS Don't forget to path your new ruby, something like: PPS不要忘记路径你的新红宝石,如:

export PATH="$PATH:/usr/local/opt/ruby/bin"]

PPPS If you would like to use rvm, try this link: http://www.moncefbelyamani.com/how-to-install-xcode-homebrew-git-rvm-ruby-on-mac/ PPPS如果您想使用rvm,请尝试以下链接: http//www.moncefbelyamani.com/how-to-install-xcode-homebrew-git-rvm-ruby-on-mac/

RVM main site doesn't install properly on OS X Lion. RVM主站点无法在OS X Lion上正确安装。 The instructions are incorrect, the error messages it spews are incorrect (refer to non-existent log files, etc). 说明不正确,它喷出的错误消息不正确(请参阅不存在的日志文件等)。

Route that (eventually) worked for me: (最终)为我工作的路线:

  1. Open Xcode, go to Preferences - Downloads 打开Xcode,转到首选项 - 下载
  2. Make sure that "Command Line Tools" is installed (150 MB download); 确保安装了“命令行工具”(150 MB下载); this is (silently) required for Ruby to install, and used to be part of OSX / Xcode by default, but no longer 这是(默默地)Ruby需要安装,并且默认情况下曾经是OSX / Xcode的一部分,但不再是
  3. Ignore the RVM website - it links to bad installers for OS X (don't bother, not worth the pain. I tried them, they failed) 忽略RVM网站 - 它链接到OS X的不良安装程序(不要打扰,不值得痛苦。我试过它们,但它们失败了)
  4. use JewelryBox, which is a little less rubbish than the official installer: http://unfiniti.com/software/mac/jewelrybox 使用JewelryBox,这比官方安装程序少一些垃圾: http ://unfiniti.com/software/mac/jewelrybox
  5. Run it, click Add Ruby, select ruby-1.9.3-p125 (has to be that version or higher, or it won't compile, because the previous versions need a compiler thats no longer in OS X) 运行它,单击Add Ruby,选择ruby-1.9.3-p125(必须是该版本或更高版本,否则它将无法编译,因为以前的版本需要一个不再在OS X中的编译器)
  6. Select "Autodetect" and "use clang" 选择“自动检测”和“使用铿锵”
  7. ...wait a LONG time... ......等待很长时间......
  8. If JewelryBox crashes immediately, it means you missed either step 2 above, or step 6 above (RVM crashes spectacularly if clang isn't installed, and neither RVM nor jewelrybox checks in advance) 如果JewelryBox立即崩溃,则表示您错过了上面的第2步或上面的第6步(如果没有安装clang,则RVM会崩溃,并且RVM和珠宝盒都不会提前检查)

NB -- downloading will take approx 5 mins; NB - 下载大约需要5分钟; "installing" will take 30-45 mins, because everything has to be compiled. “安装”将需要30-45分钟,因为一切都必须编译。 There is apparently no "normal" way of installing Ruby :(. 显然没有安装Ruby的“正常”方式:(。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM