Creating and Deploying a Simple Rails Application

Now that we’ve configured our servers to receive our applicaiton, let’s create one and deploy it! We’re going to create a simple Ruby on Rails applicaiton and us Capistrano for the deployment process.

  1. Install Rails/Capistrano
  2. Create a New Application
  3. Create a Simple People Page
  4. Create Deployment File
  5. Deploy the Application
  6. Commit Our Work

Install Rails/Capistrano

Open up your Gemfile and add the following lines:

1 gem 'rails'

Now, run bundle install to install rails and capistrano:

 1 $ bundle install
 2 Fetching gem metadata from http://rubygems.org/.....
 3 Using rake (0.9.2.2) 
 4 Using Platform (0.4.0) 
 5 Using i18n (0.6.1) 
 6 Using multi_json (1.3.6) 
 7 Using activesupport (3.2.8) 
 8 Using builder (3.0.3) 
 9 Using activemodel (3.2.8) 
10 Using erubis (2.7.0) 
11 Using journey (1.0.4) 
12 Using rack (1.4.1) 
13 Using rack-cache (1.2) 
14 Using rack-test (0.6.2) 
15 Using hike (1.2.1) 
16 Using tilt (1.3.3) 
17 Using sprockets (2.1.3) 
18 Using actionpack (3.2.8) 
19 Using mime-types (1.19) 
20 Using polyglot (0.3.3) 
21 Using treetop (1.4.10) 
22 Using mail (2.4.4) 
23 Using actionmailer (3.2.8) 
24 Using arel (3.0.2) 
25 Using tzinfo (0.3.33) 
26 Using activerecord (3.2.8) 
27 Using activeresource (3.2.8) 
28 Using archive-tar-minitar (0.5.2) 
29 Using bunny (0.7.9) 
30 Using highline (1.6.15) 
31 Using json (1.5.4) 
32 Using mixlib-log (1.4.1) 
33 Using mixlib-authentication (1.3.0) 
34 Using mixlib-cli (1.2.2) 
35 Using mixlib-config (1.1.2) 
36 Using mixlib-shellout (1.1.0) 
37 Using moneta (0.6.0) 
38 Using net-ssh (2.2.2) 
39 Using net-ssh-gateway (1.1.0) 
40 Using net-ssh-multi (1.1) 
41 Using ipaddress (0.8.0) 
42 Using systemu (2.5.2) 
43 Using yajl-ruby (1.1.0) 
44 Using ohai (6.14.0) 
45 Using rest-client (1.6.7) 
46 Using uuidtools (2.1.3) 
47 Using chef (10.14.2) 
48 Using ffi (1.0.11) 
49 Using childprocess (0.3.5) 
50 Using configuration (1.3.2) 
51 Using diff-lcs (1.1.3) 
52 Using gherkin (2.11.2) 
53 Using cucumber (1.2.1) 
54 Using launchy (0.4.0) 
55 Using knife-github-cookbooks (0.1.7) 
56 Using log4r (1.1.10) 
57 Using net-scp (1.0.4) 
58 Using open4 (1.3.0) 
59 Using popen4 (0.1.2) 
60 Using progressbar (0.11.0) 
61 Using rack-ssl (1.3.2) 
62 Using bundler (1.1.5) 
63 Using rdoc (3.12) 
64 Using thor (0.14.6) 
65 Using railties (3.2.8) 
66 Installing rails (3.2.8) 
67 Using rspec-core (2.11.1) 
68 Using rspec-expectations (2.11.3) 
69 Using rspec-mocks (2.11.3) 
70 Using rspec (2.11.0) 
71 Using vagrant (1.0.5) 
72 Using virtualbox (0.9.2) 
73 Using veewee (0.2.3) 
74 Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.

Create a New Application

To create our new applicationm run the rails new command:

  1 $ rails new myapp
  2 rails new myapp
  3       create  
  4       create  README.rdoc
  5       create  Rakefile
  6       create  config.ru
  7       create  .gitignore
  8       create  Gemfile
  9       create  app
 10       create  app/assets/images/rails.png
 11       create  app/assets/javascripts/application.js
 12       create  app/assets/stylesheets/application.css
 13       create  app/controllers/application_controller.rb
 14       create  app/helpers/application_helper.rb
 15       create  app/mailers
 16       create  app/models
 17       create  app/views/layouts/application.html.erb
 18       create  app/mailers/.gitkeep
 19       create  app/models/.gitkeep
 20       create  config
 21       create  config/routes.rb
 22       create  config/application.rb
 23       create  config/environment.rb
 24       create  config/environments
 25       create  config/environments/development.rb
 26       create  config/environments/production.rb
 27       create  config/environments/test.rb
 28       create  config/initializers
 29       create  config/initializers/backtrace_silencers.rb
 30       create  config/initializers/inflections.rb
 31       create  config/initializers/mime_types.rb
 32       create  config/initializers/secret_token.rb
 33       create  config/initializers/session_store.rb
 34       create  config/initializers/wrap_parameters.rb
 35       create  config/locales
 36       create  config/locales/en.yml
 37       create  config/boot.rb
 38       create  config/database.yml
 39       create  db
 40       create  db/seeds.rb
 41       create  doc
 42       create  doc/README_FOR_APP
 43       create  lib
 44       create  lib/tasks
 45       create  lib/tasks/.gitkeep
 46       create  lib/assets
 47       create  lib/assets/.gitkeep
 48       create  log
 49       create  log/.gitkeep
 50       create  public
 51       create  public/404.html
 52       create  public/422.html
 53       create  public/500.html
 54       create  public/favicon.ico
 55       create  public/index.html
 56       create  public/robots.txt
 57       create  script
 58       create  script/rails
 59       create  test/fixtures
 60       create  test/fixtures/.gitkeep
 61       create  test/functional
 62       create  test/functional/.gitkeep
 63       create  test/integration
 64       create  test/integration/.gitkeep
 65       create  test/unit
 66       create  test/unit/.gitkeep
 67       create  test/performance/browsing_test.rb
 68       create  test/test_helper.rb
 69       create  tmp/cache
 70       create  tmp/cache/assets
 71       create  vendor/assets/javascripts
 72       create  vendor/assets/javascripts/.gitkeep
 73       create  vendor/assets/stylesheets
 74       create  vendor/assets/stylesheets/.gitkeep
 75       create  vendor/plugins
 76       create  vendor/plugins/.gitkeep
 77          run  bundle install
 78 Fetching gem metadata from https://rubygems.org/.........
 79 Using rake (0.9.2.2) 
 80 Using i18n (0.6.1) 
 81 Using multi_json (1.3.6) 
 82 Using activesupport (3.2.8) 
 83 Using builder (3.0.3) 
 84 Using activemodel (3.2.8) 
 85 Using erubis (2.7.0) 
 86 Using journey (1.0.4) 
 87 Using rack (1.4.1) 
 88 Using rack-cache (1.2) 
 89 Using rack-test (0.6.2) 
 90 Using hike (1.2.1) 
 91 Using tilt (1.3.3) 
 92 Using sprockets (2.1.3) 
 93 Using actionpack (3.2.8) 
 94 Using mime-types (1.19) 
 95 Using polyglot (0.3.3) 
 96 Using treetop (1.4.10) 
 97 Using mail (2.4.4) 
 98 Using actionmailer (3.2.8) 
 99 Using arel (3.0.2) 
100 Using tzinfo (0.3.33) 
101 Using activerecord (3.2.8) 
102 Using activeresource (3.2.8) 
103 Using bundler (1.1.5) 
104 Installing coffee-script-source (1.3.3) 
105 Installing execjs (1.4.0) 
106 Installing coffee-script (2.2.0) 
107 Using rack-ssl (1.3.2) 
108 Using json (1.7.5) 
109 Using rdoc (3.12) 
110 Using thor (0.16.0) 
111 Using railties (3.2.8) 
112 Installing coffee-rails (3.2.2) 
113 Installing jquery-rails (2.1.3) 
114 Using rails (3.2.8) 
115 Installing sass (3.2.1) 
116 Installing sass-rails (3.2.5) 
117 Installing sqlite3 (1.3.6) with native extensions 
118 Installing uglifier (1.3.0) 
119 Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.

Now, let’s configure our new application to use mysql and capistrano. cd into your new applicaiton directory:

1 $ cd myapp

and open the Gemfile there. Add the following lines:

1 gem 'mysql2'
2 gem 'capistrano'
3 gem 'therubyracer', :platforms => :ruby

Now run the bundle install command to install those new gems:

 1 $ bundle install
 2 Fetching gem metadata from https://rubygems.org/........
 3 Using rake (0.9.2.2) 
 4 Using i18n (0.6.1) 
 5 Using multi_json (1.3.6) 
 6 Using activesupport (3.2.8) 
 7 Using builder (3.0.3) 
 8 Using activemodel (3.2.8) 
 9 ...
10 Installing capistrano (2.13.4) 
11 Using coffee-script-source (1.3.3) 
12 Using execjs (1.4.0) 
13 Using coffee-script (2.2.0) 
14 Using rack-ssl (1.3.2) 
15 Using json (1.7.5) 
16 Using rdoc (3.12) 
17 Using thor (0.16.0) 
18 Using railties (3.2.8) 
19 Using coffee-rails (3.2.2) 
20 Using jquery-rails (2.1.3) 
21 Installing mysql2 (0.3.11) with native extensions 
22 ...

Create a Simple People Page"

Next, we’re going to create a simple people page whee you can create, update and delete names of people in the database. Rails already has “scaffolding” which means we can do this without writing any code. :-)

Within the myapp directory, use the rails generate command to create the poeple scaffolding:

 1 $ rails generate scaffold Person name:string
 2       invoke  active_record
 3       create    db/migrate/20120927193700_create_people.rb
 4       create    app/models/person.rb
 5       invoke    test_unit
 6       create      test/unit/person_test.rb
 7       create      test/fixtures/people.yml
 8       invoke  resource_route
 9        route    resources :people
10       invoke  scaffold_controller
11       create    app/controllers/people_controller.rb
12       invoke    erb
13       create      app/views/people
14       create      app/views/people/index.html.erb
15       create      app/views/people/edit.html.erb
16       create      app/views/people/show.html.erb
17       create      app/views/people/new.html.erb
18       create      app/views/people/_form.html.erb
19       invoke    test_unit
20       create      test/functional/people_controller_test.rb
21       invoke    helper
22       create      app/helpers/people_helper.rb
23       invoke      test_unit
24       create        test/unit/helpers/people_helper_test.rb
25       invoke  assets
26       invoke    coffee
27       create      app/assets/javascripts/people.js.coffee
28       invoke    scss
29       create      app/assets/stylesheets/people.css.scss
30       invoke  scss
31       create    app/assets/stylesheets/scaffolds.css.scss

From the top: The rails scaffolding generator creates a heap of working code for us, including the database table migrations, test files, controllers, views, forms and all the glue necessary for it all to work together.

Let’s test out our application locally by migrating the database (creating new tables) and running the local server:

rake db:migrate
==  CreatePeople: migrating ===================================================
-- create_table(:people)
   -> 0.0010s
==  CreatePeople: migrated (0.0010s) ==========================================

claco@hank ~/devops_toolbox/myapp (master) (ruby-1.9.3-p125@devops_toolbox)
 → rails s
=> Booting WEBrick
=> Rails 3.2.8 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
[2012-09-27 15:45:36] INFO  WEBrick 1.3.1
[2012-09-27 15:45:36] INFO  ruby 1.9.3 (2012-02-16) [x86_64-darwin11.3.0]
[2012-09-27 15:45:36] INFO  WEBrick::HTTPServer#start: pid=40938 port=3000

Now point to your browser to http://localhost:3000/people. Click the New Person link and have some fun!

Back in the console, hit CTRL-C to quit the local development server. Before we start the deployment process, let’s delete the local development database and also take a look at the default database.yml file:

 1 ^C[2012-09-27 15:51:31] INFO  going to shutdown ...
 2 [2012-09-27 15:51:31] INFO  WEBrick::HTTPServer#start done.
 3 Exiting
 4 
 5 $ rm db/development.sqlite3
 6 
 7 $ cat config/database.yml
 8 
 9 # SQLite version 3.x
10 #   gem install sqlite3
11 #
12 #   Ensure the SQLite 3 gem is defined in your Gemfile
13 #   gem 'sqlite3'
14 development:
15   adapter: sqlite3
16   database: db/development.sqlite3
17   pool: 5
18   timeout: 5000
19 
20 # Warning: The database defined as "test" will be erased and
21 # re-generated from your development database when you run "rake".
22 # Do not set this db to the same as development or production.
23 test:
24   adapter: sqlite3
25   database: db/test.sqlite3
26   pool: 5
27   timeout: 5000
28 
29 production:
30   adapter: sqlite3
31   database: db/production.sqlite3
32   pool: 5
33   timeout: 5000

If you remember when we customized our webb server recipe, we created a custom database.yml that contained the correct information for the web server instances we’re deploying to. Rails best practices usually dictate that rails applications copy the stock database.yml [above] to database.yml.example, then tell git to ignore database.yml. The idea is that database.yml is never comitted to source code, keeping and server passwords private. Then during deployments, a server local version [like the one we have in our recipe] will be copied into place.

1 $ cp config/database.yml config/database.yml.example
2 $ echo "database.yml" >> .gitignore

Create Deployment File

We’re going to use Capistrano to deploy our application to the cagrant server instances. Within the myapp directory, run the capify command:

1 capify .
2 [add] writing './Capfile'
3 [add] writing './config/deploy.rb'
4 [done] capified!

Now, open config/deploy.rb in your editor and replace it’s contents with the following:

 1 require "bundler/capistrano"
 2 
 3 set :application, "myapp"
 4 set :deploy_to, "/var/www/myapp"
 5 set :deploy_via, :copy
 6 set :user, "myapp"
 7 
 8 set :rails_env, "development"
 9 set :use_sudo, false
10 
11 set :scm, :none
12 set :repository, "./"
13 
14 role :web, "10.10.10.10"                          # Your HTTP server, Apache/etc
15 role :app, "10.10.10.10"                          # This may be the same as your `Web` server
16 role :db,  "10.10.10.10", :primary => true # This is where Rails migrations will run
17 
18 after "deploy:finalize_update", "deploy:copy_database_yml"
19 
20 namespace :deploy do
21   task :start do ; end
22   task :stop do ; end
23   task :restart, :roles => :app, :except => { :no_release => true } do
24     run "#{try_sudo} touch #{File.join(current_path,'tmp','restart.txt')}"
25   end
26 
27   task :copy_database_yml do
28     run "cp #{shared_path}/database.yml #{release_path}/config/database.yml"
29   end
30 end

That’s a lot of code, but it’s pretty simple. Let’s brea it down.

On Line 1, we load the bundler/capistrano code. This makes the deployment process aware of bundle and Gemfiles.
Lines 3-6, we se the app name, the directory to deploy to, the deployment method (file copy) and the remote user to run the commands as. That’s the user we created in our customer recipes!
Lines 8-9, we set the default rails environment and disable sudo since the myapp user won’t need it.
Lines 14-16, we tell capistrano the server to deploy to, in this case, our local vagrant instances.
Lines 18 says “after updating, copy over the database yml we created” in our cookbook recipe.
Lines 20-29 tells capistrano how to make passenger restart the app, how to copy the database.yml file.

Deploy the Application

Now that we’ve got a deployment script, let’s ensure our vagrant instances are fully up to date, then use the deploy:setup and deploy:cold to deploy our application:

 1 $ cd ../instances/cluster
 2 $ vagrant up
 3 $ vagrant provision
 4 
 5 $ cd ../../myapp
 6 
 7 $ cap deploy:setup
 8   * executing `deploy:setup'
 9   * executing "mkdir -p /var/www/myapp /var/www/myapp/releases /var/www/myapp/shared /var/www/myapp/shared/system /var/www/myapp/shared/log /var/www/myapp/shared/pids"
10     servers: ["10.10.10.10"]
11 Password: myapp_1234
12     [10.10.10.10] executing command
13     command finished in 20ms
14   * executing "chmod g+w /var/www/myapp /var/www/myapp/releases /var/www/myapp/shared /var/www/myapp/shared/system /var/www/myapp/shared/log /var/www/myapp/shared/pids"
15     servers: ["10.10.10.10"]
16     [10.10.10.10] executing command
17     command finished in 17ms

From the top: The very first time we run capistrano to deploy to a server, we need to run the setup task. This creates all of the remote directories capistrano will ned in the future for itself and passenger, like log directories, pid directories, etc.

 1 $ cap deploy:cold
 2 
 3   * executing `deploy:cold'
 4   * executing `deploy:update'
 5  ** transaction: start
 6   * executing `deploy:update_code'
 7   * getting (via checkout) revision  to /var/folders/nf/zwnznxhj35n_143061ppg9rr0000gn/T/20120927203353
 8     executing locally: cp -R ./ /var/folders/nf/zwnznxhj35n_143061ppg9rr0000gn/T/20120927203353
 9     command finished in 38ms
10   * Compressing /var/folders/nf/zwnznxhj35n_143061ppg9rr0000gn/T/20120927203353 to /var/folders/nf/zwnznxhj35n_143061ppg9rr0000gn/T/20120927203353.tar.gz
11     executing locally: tar czf 20120927203353.tar.gz 20120927203353
12     command finished in 89ms
13     servers: ["10.10.10.10"]
14 Password: myapp_1234
15  ** sftp upload /var/folders/nf/zwnznxhj35n_143061ppg9rr0000gn/T/20120927203353.tar.gz -> /tmp/20120927203353.tar.gz
16     [10.10.10.10] /tmp/20120927203353.tar.gz
17     [10.10.10.10] done
18   * sftp upload complete
19   * executing "cd /var/www/myapp/releases && tar xzf /tmp/20120927203353.tar.gz && rm /tmp/20120927203353.tar.gz"
20     servers: ["10.10.10.10"]
21     [10.10.10.10] executing command
22     command finished in 37ms
23   * executing `deploy:finalize_update'
24     triggering before callbacks for `deploy:finalize_update'
25   * executing `bundle:install'
26   * executing "cd /var/www/myapp/releases/20120927203353 && bundle install --gemfile /var/www/myapp/releases/20120927203353/Gemfile --path /var/www/myapp/shared/bundle --deployment --quiet --without development test"
27     servers: ["10.10.10.10"]
28     [10.10.10.10] executing command
29     command finished in 23721ms
30   * executing "chmod -R g+w /var/www/myapp/releases/20120927203353"
31     servers: ["10.10.10.10"]
32     [10.10.10.10] executing command
33     command finished in 16ms
34   * executing "rm -rf /var/www/myapp/releases/20120927203353/public/system && mkdir -p /var/www/myapp/releases/20120927203353/public/"
35     servers: ["10.10.10.10"]
36     [10.10.10.10] executing command
37     command finished in 16ms
38   * executing "ln -s /var/www/myapp/shared/system /var/www/myapp/releases/20120927203353/public/system"
39     servers: ["10.10.10.10"]
40     [10.10.10.10] executing command
41     command finished in 17ms
42   * executing "rm -rf /var/www/myapp/releases/20120927203353/log"
43     servers: ["10.10.10.10"]
44     [10.10.10.10] executing command
45     command finished in 16ms
46   * executing "ln -s /var/www/myapp/shared/log /var/www/myapp/releases/20120927203353/log"
47     servers: ["10.10.10.10"]
48     [10.10.10.10] executing command
49     command finished in 15ms
50   * executing "rm -rf /var/www/myapp/releases/20120927203353/tmp/pids && mkdir -p /var/www/myapp/releases/20120927203353/tmp/"
51     servers: ["10.10.10.10"]
52     [10.10.10.10] executing command
53     command finished in 17ms
54   * executing "ln -s /var/www/myapp/shared/pids /var/www/myapp/releases/20120927203353/tmp/pids"
55     servers: ["10.10.10.10"]
56     [10.10.10.10] executing command
57     command finished in 15ms
58   * executing "find /var/www/myapp/releases/20120927203353/public/images /var/www/myapp/releases/20120927203353/public/stylesheets /var/www/myapp/releases/20120927203353/public/javascripts -exec touch -t 201209272034.21 {} ';'; true"
59     servers: ["10.10.10.10"]
60     [10.10.10.10] executing command
61 *** [err :: 10.10.10.10] find: /var/www/myapp/releases/20120927203353/public/images: No such file or directory
62 *** [err :: 10.10.10.10] find: /var/www/myapp/releases/20120927203353/public/stylesheets: No such file or directory
63 *** [err :: 10.10.10.10] find: /var/www/myapp/releases/20120927203353/public/javascripts: No such file or directory
64     command finished in 16ms
65     triggering after callbacks for `deploy:finalize_update'
66   * executing `deploy:copy_database_yml'
67   * executing "cp /var/www/myapp/shared/database.yml /var/www/myapp/releases/20120927203353/config/database.yml"
68     servers: ["10.10.10.10"]
69     [10.10.10.10] executing command
70     command finished in 16ms
71   * executing `deploy:create_symlink'
72   * executing "rm -f /var/www/myapp/current && ln -s /var/www/myapp/releases/20120927203353 /var/www/myapp/current"
73     servers: ["10.10.10.10"]
74     [10.10.10.10] executing command
75     command finished in 16ms
76  ** transaction: commit
77   * executing `deploy:migrate'
78   * executing "cd /var/www/myapp/releases/20120927203353 && bundle exec rake RAILS_ENV=development  db:migrate"
79     servers: ["10.10.10.10"]
80     [10.10.10.10] executing command
81  ** [out :: 10.10.10.10] ==  CreatePeople: migrating ===================================================
82  ** [out :: 10.10.10.10] -- create_table(:people)
83  ** [out :: 10.10.10.10] -> 0.0030s
84  ** [out :: 10.10.10.10] ==  CreatePeople: migrated (0.0031s) ==========================================
85  ** [out :: 10.10.10.10] 
86     command finished in 3214ms
87   * executing `deploy:start'

From the top: IF all goes well, the deploy cold task copied up your myapp source, installed the gems using bundler, copied the database.yml, and connected to the db server instance to migrate the database and create the table.

Let’s open up a browser and try it out: http://10.10.10.10/people

Let’s look around the servers and inspect our work!

 1 $ cd ../instances/cluster
 2 $ vagrant ssh web
 3 [vagrant@web ~]$ ls /var/www/myapp/current
 4 app  Capfile  config  config.ru  db  doc  Gemfile  Gemfile.lock  lib  log  public  Rakefile  README.rdoc  REVISION  script  test  tmp  vendor
 5 
 6 $ mysql -u myapp -p -D myapp -h 10.10.10.11
 7 Enter password: myapp_1234
 8 Reading table information for completion of table and column names
 9 You can turn off this feature to get a quicker startup with -A
10 
11 Welcome to the MySQL monitor.  Commands end with ; or \g.
12 Your MySQL connection id is 18
13 Server version: 5.0.95-log Source distribution
14 
15 Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
16 
17 Oracle is a registered trademark of Oracle Corporation and/or its
18 affiliates. Other names may be trademarks of their respective
19 owners.
20 
21 Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
22 
23 mysql> select * from people;
24 +----+-------+---------------------+---------------------+
25 | id | name  | created_at          | updated_at          |
26 +----+-------+---------------------+---------------------+
27 |  1 | Chris | 2012-09-27 20:39:42 | 2012-09-27 20:39:42 | 
28 +----+-------+---------------------+---------------------+
29 1 row in set (0.00 sec)
30 
31 mysql>

Fan-flippin-tastic!

Commit Our Work

Let’s commit our new application and other changes into the git repo.

 1 $ cd ../..
 2 $ git add .
 3 git commit -m "Created rails applicaiton and deployment."
 4 [master 39d129f] Created rails applicaiton and deployment.
 5  59 files changed, 1673 insertions(+), 11 deletions(-)
 6  create mode 100644 myapp/.gitignore
 7  create mode 100644 myapp/Capfile
 8  create mode 100644 myapp/Gemfile
 9  create mode 100644 myapp/Gemfile.lock
10  create mode 100644 myapp/README.rdoc
11  create mode 100644 myapp/Rakefile
12  create mode 100644 myapp/app/assets/images/rails.png
13  create mode 100644 myapp/app/assets/javascripts/application.js
14  create mode 100644 myapp/app/assets/javascripts/people.js.coffee
15  create mode 100644 myapp/app/assets/stylesheets/application.css
16  create mode 100644 myapp/app/assets/stylesheets/people.css.scss
17  create mode 100644 myapp/app/assets/stylesheets/scaffolds.css.scss
18  create mode 100644 myapp/app/controllers/application_controller.rb
19  create mode 100644 myapp/app/controllers/people_controller.rb
20  create mode 100644 myapp/app/helpers/application_helper.rb
21  create mode 100644 myapp/app/helpers/people_helper.rb
22  create mode 100644 myapp/app/mailers/.gitkeep
23  create mode 100644 myapp/app/models/.gitkeep
24  create mode 100644 myapp/app/models/person.rb
25  create mode 100644 myapp/app/views/layouts/application.html.erb
26  create mode 100644 myapp/app/views/people/_form.html.erb
27  create mode 100644 myapp/app/views/people/edit.html.erb
28  create mode 100644 myapp/app/views/people/index.html.erb
29  create mode 100644 myapp/app/views/people/new.html.erb
30  create mode 100644 myapp/app/views/people/show.html.erb
31  create mode 100644 myapp/config.ru
32  create mode 100644 myapp/config/application.rb
33  create mode 100644 myapp/config/boot.rb
34  create mode 100644 myapp/config/database.yml.example
35  create mode 100644 myapp/config/deploy.rb
36  create mode 100644 myapp/config/environment.rb
37  create mode 100644 myapp/config/environments/development.rb
38  create mode 100644 myapp/config/environments/production.rb
39  create mode 100644 myapp/config/environments/test.rb
40  create mode 100644 myapp/config/initializers/backtrace_silencers.rb
41  create mode 100644 myapp/config/initializers/inflections.rb
42  create mode 100644 myapp/config/initializers/mime_types.rb
43  create mode 100644 myapp/config/initializers/secret_token.rb
44  create mode 100644 myapp/config/initializers/session_store.rb
45  create mode 100644 myapp/config/initializers/wrap_parameters.rb
46  create mode 100644 myapp/config/locales/en.yml
47  create mode 100644 myapp/config/routes.rb
48  create mode 100644 myapp/db/migrate/20120927193700_create_people.rb
49  create mode 100644 myapp/db/schema.rb
50  create mode 100644 myapp/db/seeds.rb
51  create mode 100644 myapp/doc/README_FOR_APP
52  create mode 100644 myapp/lib/assets/.gitkeep
53  create mode 100644 myapp/lib/tasks/.gitkeep
54  create mode 100644 myapp/log/.gitkeep
55  create mode 100644 myapp/public/404.html
56  create mode 100644 myapp/public/422.html
57  create mode 100644 myapp/public/500.html
58  create mode 100644 myapp/public/favicon.ico
59  create mode 100644 myapp/public/index.html
60  create mode 100644 myapp/public/robots.txt
61  create mode 100755 myapp/script/rails
62  create mode 100644 myapp/test/fixtures/.gitkeep
63  create mode 100644 myapp/test/fixtures/people.yml
64  create mode 100644 myapp/test/functional/.gitkeep
65  create mode 100644 myapp/test/functional/people_controller_test.rb
66  create mode 100644 myapp/test/integration/.gitkeep
67  create mode 100644 myapp/test/performance/browsing_test.rb
68  create mode 100644 myapp/test/test_helper.rb
69  create mode 100644 myapp/test/unit/.gitkeep
70  create mode 100644 myapp/test/unit/helpers/people_helper_test.rb
71  create mode 100644 myapp/test/unit/person_test.rb
72  create mode 100644 myapp/vendor/assets/javascripts/.gitkeep
73  create mode 100644 myapp/vendor/assets/stylesheets/.gitkeep
74  create mode 100644 myapp/vendor/plugins/.gitkeep

To Continue…

  1. Introduction – Introduction
  2. Installing Prerequisites – XCode, CommandLineTools, Homebrew, RVM, Ruby, and VirtualBox
  3. Project Setup – Create the git repository and directory structure for Vagrant, Chef, etc.
  4. Vagrant/Veewee Installation – Install Vagrant/Vewee to create/control VirtualBox machines
  5. Define/Create a Vagrant Box – Define and Create a Vagrant Box for use i VirtualBox
  6. Provisioning Machines with Vagrant – Provision a cluster (Web/DB) of machines using Vagrant
  7. Configuring Machines Using Chef Solo – Configuring our new machine instances using Chef Solo
  8. Customizing Recipes for Our Application – Customize the recipes we have to prepare for our application deployment
  9. Create and Deploy a Rails Applications – Create a simple Rails application and deploy it to our Vagrant instances
  10. Migrate from Chef Solo to Hosted Chef – Migrate from using Chef Solo to hosted Chef at OpsCode
  11. Migrate Servers to RackCloud – Migrate your servers from VirtualBox to “The Cloud” using Rackspace.
See more posts about: devops toolbox | All Categories