Starting a new Ruby on Rails Application

rails new App Name -T

Then I open up the Gemfile
and add:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
gem 'jquery-rails'
gem 'devise'

group :development do
  gem "nifty-generators"
  gem 'rspec-rails', '2.1.0'
  gem 'annotate'
end

group :test do
  gem 'rspec', '2.1.0'
  gem 'factory_girl'
end

group :cucumber do
  gem 'cucumber-rails'
  gem 'capybara'
  gem 'email_spec'
  gem 'launchy'
end

I then run the following in this Order

1
2
3
4
5
6
7
rails g rspec:install
rails g jquery:install
rails g cucumber:install
rails g email_spec:steps
rails g devise:install
rails g devise:views
rails g nifty:layout

Now lets put some pages in place

1
rails g controller pages home about contact privacy

and update our routes file

Replace:

1
2
3
4
5
6
7
  get "pages/home"

  get "pages/about"

  get "pages/contact"

  get "pages/privacy"

with:

1
2
3
4
5
6
  match '/about' => 'pages#about', :as => :about
  match '/contact' => 'pages#contact', :as => :contact
  match '/privacy' => 'pages#privacy', :as => :privacy
  match '/' => 'pages#home', :as => :home

  root :to => "pages#home"

Delete public/index.html

1
rm public/index.html

Now lets Git started

1
2
3
git init
git add .
git commit -m "initial commit"

heroku ;-)

1
2
heroku create <em>App Name</em>
git push heroku master

github ;-)

1
2
git remote add origin git@github.com:<em>username</em>/<em>App Name</em>.git
git push -u origin master

In the Next Post we will start developing our App using Behavior Driven Development using cucumber

About Mark Wagner

Mark Wagner has his Computer Information Systems degree from DeVry University, Phoenix. His high-level programming skills and creative problem-solving abilities, makes him the perfect programmer for our organization. He has earned his credentials as a Certified Oracle Database Administrator and Red Hat Engineer. Mark has 12 years working experience ranging from small .com start-ups to the "blue-ist of blue chip companies."
This entry was posted in Devise, Git, Ruby on Rails and tagged , , . Bookmark the permalink.

One Response to Starting a new Ruby on Rails Application

  1. Pingback: BDD – Behavior Driven Development – Rails 3, cucumber & rspec – Part 1 Devise |

Leave a Reply