I have jumped on board the RVM bandwagon for managing my development environments. I recently sold my Mac Pro on eBay and have a fresh new 27" iMac on the way. So I thought I’d document this part of the install process and a couple of gotcha’s.
First, grab the Postgres one-click installer and run it. Or you can build & compile it from source. Then for RVM and the latest REE follow these instructions;
# install readline for OSX if needed - check if it already exists in /usr/local/lib wget ftp://ftp.cwru.edu/pub/bash/readline-6.1.tar.gz tar -xvzf readline-6.1.tar.gz cd readline-6.1 ./configure && make && sudo make install # install RVM from github bash < <( curl http://rvm.beginrescueend.com/releases/rvm-install-head ) # edit your .bash_login (or profile) and add this at the bottom [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # check RVM has installed OK, look for 'is a function' . ~/.bash_login type rvm | head -n1 rvm notes # install REE, or whatever Ruby you'd like rvm install ree -C --enable-shared,--with-readline-dir=/usr/local # show what rubies are installed rvm list # set REE as the default and current ruby rvm --default ree # check your working directories which ruby && which gem # In general I use Bundler for apps, but for .irbrc and some scripts I need these too gem install wirble awesome_print hirb bundler mysql heroku # and finally for the postgres (pg) gem sudo env ARCHFLAGS='-arch i386' gem install pg
I’m surprised by how few steps it takes these days (to get Ruby & Rails up and running with a database), four years ago this was a different story altogether. With tools like RVM and Bundler, it couldn’t be simpler.
2 comments so far
Rob Zolkos Aug 31, 2010
Thanks. This saved me some time! And worked perfectly.
Rodrigo Pinto Oct 12, 2010
Thanks guy, perfect post.
It`s works fine with default gem, but when im using an other gemset that i`ve created don`t work…
Do you have some idea?
Cheers, Rodrigo Pinto