Getting started with Rails 3

Installation

first lets get a copy of rails 3 going

# make sure you have gem bundler and rack installed:
sudo gem install bundler rack

# clone of edge rails
git clone git://github.com/rails/rails.git

# generate a new app:
ruby rails/railties/bin/rails my_app
cd my_app

generate a new app:

ruby rails/railties/bin/rails my_app
cd my_app

now we have to edit our ./Gemfile with some required gems that have not been released yet.

git "git://github.com/rails/arel.git"
gem "rails", :git => "git://github.com/rails/rails.git"

then use the new gem bundler to bundle additional required gems:

gem bundle

now script/server, script/console, script/generate, etc.. should be available as normal

Configuration

I have chosen to replace some of the default configurations with my own such as changing fixtures to factories, there is a great lightweight version of factory_girl by Stephen Celis written in about 30 LOC. So we will use one of the new configurations available to us to prevent the default generators from producing fixtures automatically, also prevent the scaffold generator from creating controller layouts as I remove them anyway.

place within config/application.rb

config.generators do |g|
g.template_engine :erb, :layout => false
g.test_framework  :test_unit, :fixture => false
end

to be continued ..

About stevestmartin

A Web Application Developer based out of Tampa, FL. Currently employed as a Sr. Developer doing PHP / MySQL and UI development at TraderPlanet a social network for traders and investors. Current focuses are Ruby, Rails, BDD and Audio Production
This entry was posted in Programming, Ruby and tagged . Bookmark the permalink.

Leave a Reply

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

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>