Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I install Ruby on Mac Leopard?

Can anyone please give directions on how to install ruby 1.9 I tried installation directions given all over the web. Can't get it to work. Please kindly give step by step direction. I tried using macports but everytime I type in ruby -v it gives me 1.8.6.

like image 822
Ken Avatar asked Nov 30 '09 00:11

Ken


People also ask

Do I need to install Ruby on Mac?

There's no need to download Ruby source code and compile for macOS because Homebrew and software version managers such as asdf, chruby, rbenv, or rvm provide Ruby installation utilities. If you are building only one project with Ruby (for example, if you are a student learning Ruby), install Ruby with Homebrew.

Is Ruby available on Mac?

ruby-build can also be used as a standalone program without rbenv. It is available for macOS, Linux, and other UNIX-like operating systems.

How do I know if Ruby is installed on my Mac?

Pre-installed macOS system Ruby MacOS comes with a “system Ruby” pre-installed. If you see /usr/bin/ruby when you use the which command, it is the pre-installed macOS system Ruby.


2 Answers

rvm is easiest way to manage your ruby installation on OSX.

If you are using rvm, you will able to install 1.9.1, 1.9.2, jruby, ree by typing rvm install 1.9.1

type rvm default to reset your ruby version back to 1.8.6

How to install rvm

sudo gem install rvm -s http://gemcutter.org/

rvm-install

rvm install 1.9.1

rvm use 1.9.1

ruby -v  # show ruby 1.9.1 version

rvm default

ruby -v  # show ruby 1.8.6 version

cheers

like image 95
bry4n Avatar answered Sep 21 '22 06:09

bry4n


Install Homebrew.

brew install ruby installs the current stable version of ruby.

like image 42
Debilski Avatar answered Sep 23 '22 06:09

Debilski