Ruby on Rails envy part 3 – Getting started with Rails 3 on Snow Leopard

This is the third post about getting started on Ruby on Rails. Now I'm on my MacBook, which I ust upgraded from 10.5 to 10.6.6. Since Ruby is already installed on the Mac, I did not need to use the Bitnami virtual machine I used in the previous articles.

Installing Rails

Here's how I got ROR running on my MacBook:

  • Install Git here
  • Install RVM from a Terminal like this:
    bash < <( curl http://rvm.beginrescueend.com/releases/rvm-install-head )
    
  • add this to ~/.profile:
    [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
    

    Then logout the terminal and log back in.

  • Install Rails 1.9.2 like so:
      rvm install 1.9.2 
  • Set 1.9.2 as default like so:
    rvm --default 1.9.2
  • Install Rails 3:
    gem install rails
  • Install sqlite 3
     gem install sqlite3-ruby
  • Check versions with
     rails -v

    and

     ruby -v 

    and see if they're OK

  • The cool thing about install Rails like this is that everything is installed in my home folder, and you can completely run your apps from you home folder. So you don't need elevated rights to install or run an application.

    Get the party started

    Create a new Rails project:

    $ rails new Weblog
    $ cd Weblog
    $ rails generate scaffold Story title:string posted_on:date storytext:text
    $ rake db:migrate
    $ rails s
    

    Now, browse to http://localhost:3000/stories to take a look at your app.

    At least you know everything is running well and I am at the same point I was here. Next time (maybe tomorrow), let's check out what actually happened.

One Reply to “Ruby on Rails envy part 3 – Getting started with Rails 3 on Snow Leopard”

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.