Skip to content

Create Rails application

02/02/2011

simple step to create sample Application with Rails3.0.3

Step 1 : Create Rails Application

$rails new sample -d mysql                          # -d to specify which database use

Step 2 : Enter to your project

$cd sample/

Step 3 : Enter your mysql user and password

$gedit config/database.yml

Step 4 :

$rake db:create

if any error like “bundle install”

$sudo bundle install

Step 5 :To create rails scaffold

$rails generate scaffold Student name:string city:string #scaffold name should be start with caps ans be a singular

Step 6 : migrate for create database

$rake db:migrate

Step 7 : Start rails server

$rails server

open browser http//:localhost:3000 #can change port no like 3003

it will show rails index page

then http//:localhost:3000/students # here scaffold name should be a plural.

successfully created sample rails application..

thanks……….

Advertisements

From → Rails

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: