Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to upgrade to ruby 1.9.2

mac os x how to upgrade to ruby 1.9.2

like image 933
Ethan Zhang Avatar asked Dec 28 '10 13:12

Ethan Zhang


People also ask

How do I install a specific version of ruby?

Use `gem install -v` You may already be familiar with gem install , but if you add the -v flag, you can specify the version of the gem to install. Using -v you can specify an exact version or use version comparators.

How do I change Ruby version on Mac?

Set Ruby version with rvm on Mac 0 on the command line. To switch to the system ruby, enter rvm use system . To switch back to the default, rvm default . The command rvm list will show all installed Rubies, including the current and default versions.

Which Ruby version should I use?

Use the newest Ruby3, which is old. If you're just starting with Ruby, install with Homebrew and work on a project with Ruby 3.0. When you start building another project, it may be time to install a version manager so you can juggle projects with different Ruby versions.


2 Answers

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.

like image 97
David Avatar answered Sep 28 '22 05:09

David


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/

like image 23
House Spider Avatar answered Sep 28 '22 04:09

House Spider