如何升级到ruby 1.9.2

时间:2021-12-08 07:23:54

mac os x how to upgrade to ruby 1.9.2

mac os x如何升级到ruby 1.9.2

3 个解决方案

#1


33  

Perhaps not the answer you're looking for in the short term, but I highly recommend looking into 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). Different versions, different gems per version, etc.

也许不是您在短期内寻找的答案,但我强烈建议您查看Ruby Version Manager。通过为您切换整个环境(通常通过更新环境变量),它可以轻松地运行Ruby的并发版本。不同版本,每个版本不同的宝石等。

#2


20  

I think that the best option is to use Homebrew. The installation is simple:

我认为最好的选择是使用Homebrew。安装很简单:

brew install ruby

By the way, RVM does not support LLVM based gcc!

顺便说一句,RVM不支持基于LLVM的gcc!

P. S. 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.

P. S. Homebrew是很好的选择,因为它有清晰而好的方式来安装东西(不破坏你的系统),你可以使用它来安装各种“包”,如git,ghc,emacs等。

P. P. S. Don't forget to path your new ruby, something like:

P. P. S.别忘了路上你的新红宝石,例如:

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

P. P. P. S. If you would like to use rvm, try this link: http://www.moncefbelyamani.com/how-to-install-xcode-homebrew-git-rvm-ruby-on-mac/

P. P. P. S.如果您想使用rvm,请尝试以下链接:http://www.moncefbelyamani.com/how-to-install-xcode-homebrew-git-rvm-ruby-on-mac/

#3


10  

RVM main site doesn't install properly on OS X Lion. The instructions are incorrect, the error messages it spews are incorrect (refer to non-existent log files, etc).

RVM主站点无法在OS X Lion上正确安装。指令不正确,它喷出的错误消息不正确(请参阅不存在的日志文件等)。

Route that (eventually) worked for me:

(最终)为我工作的路线:

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

NB -- downloading will take approx 5 mins; "installing" will take 30-45 mins, because everything has to be compiled. There is apparently no "normal" way of installing Ruby :(.

NB - 下载大约需要5分钟; “安装”将需要30-45分钟,因为一切都必须编译。显然没有安装Ruby的“正常”方式:(。

#1


33  

Perhaps not the answer you're looking for in the short term, but I highly recommend looking into 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). Different versions, different gems per version, etc.

也许不是您在短期内寻找的答案,但我强烈建议您查看Ruby Version Manager。通过为您切换整个环境(通常通过更新环境变量),它可以轻松地运行Ruby的并发版本。不同版本,每个版本不同的宝石等。

#2


20  

I think that the best option is to use Homebrew. The installation is simple:

我认为最好的选择是使用Homebrew。安装很简单:

brew install ruby

By the way, RVM does not support LLVM based gcc!

顺便说一句,RVM不支持基于LLVM的gcc!

P. S. 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.

P. S. Homebrew是很好的选择,因为它有清晰而好的方式来安装东西(不破坏你的系统),你可以使用它来安装各种“包”,如git,ghc,emacs等。

P. P. S. Don't forget to path your new ruby, something like:

P. P. S.别忘了路上你的新红宝石,例如:

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

P. P. P. S. If you would like to use rvm, try this link: http://www.moncefbelyamani.com/how-to-install-xcode-homebrew-git-rvm-ruby-on-mac/

P. P. P. S.如果您想使用rvm,请尝试以下链接:http://www.moncefbelyamani.com/how-to-install-xcode-homebrew-git-rvm-ruby-on-mac/

#3


10  

RVM main site doesn't install properly on OS X Lion. The instructions are incorrect, the error messages it spews are incorrect (refer to non-existent log files, etc).

RVM主站点无法在OS X Lion上正确安装。指令不正确,它喷出的错误消息不正确(请参阅不存在的日志文件等)。

Route that (eventually) worked for me:

(最终)为我工作的路线:

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

NB -- downloading will take approx 5 mins; "installing" will take 30-45 mins, because everything has to be compiled. There is apparently no "normal" way of installing Ruby :(.

NB - 下载大约需要5分钟; “安装”将需要30-45分钟,因为一切都必须编译。显然没有安装Ruby的“正常”方式:(。