Install HomeBrew and RVM

Introduction

OSX doesn't have a good package manager like linux with aptitude. We can get practically the same with HomeBrew and RVM.
We gonna start with HomeBrew

HomeBrew

HomeBrew is a package manager for OSX. Brew install missing stuff so easy...

Exemple :
We need wget... wait ... no wget on OSX... Crap!

$ brew install wget

All package on brew are simple ruby scripts, you can make your own !
But... How to install this awesome things :

$ ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"

Use brew doctor to scan your system, you will be warn if brew dectect incorrect package, missing link or version problem.
Now you can manage package like a boss !

RVM (for Ruby and Rails)

It's also simple to install RVM (it can take several time)

$ \curl -L https://get.rvm.io | bash -s stable --rails --autolibs=enable

When process is done you need to restart your terminal.

Now use type to see if RVM is ok.

$ type rvm | head -1

If you see rvm is a function you're done with it.

If you get other thing :

$ rvm -v
# rvm 1.19.6 or higher
$ ruby -v 
# ruby 2.0.0p0 or higher
$ rails -v
# rails 3.2.13 or higher

If you get an error on rails try to sudo gem install rails and rerun rails -v
If you get an error againnnn, try :

$ rvm list
# You get the list of ruby version
$ rvm use 2.0.0
# If you get an error here, like : RVM is not a function, selecting rubies with BlablBlblAblAbla

Add to your bashrc or zshrc

[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*

After that run brew doctor to be sure.

comments powered by Disqus