How to upgrade to ruby 1.9.2

两盒软妹~` 提交于 2019-11-30 10:58:38

问题


mac os x how to upgrade to ruby 1.9.2


回答1:


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.




回答2:


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

brew install ruby

By the way, RVM does not support LLVM based 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. P. S. Don't forget to path your new ruby, something like:

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/




回答3:


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).

Route that (eventually) worked for me:

  1. Open Xcode, go to Preferences - Downloads
  2. 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
  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)
  4. use JewelryBox, which is a little less rubbish than the official installer: 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)
  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)

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 :(.



来源:https://stackoverflow.com/questions/4546573/how-to-upgrade-to-ruby-1-9-2

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!