Dozerslist Create A Rails App

Report 5 Downloads 70 Views
 

Create A Rails App DIRECTIONS:​Follow along as you begin learning the basics of Ruby on Rails, a powerful framework for creating dynamic, data-driven websites. ❏

Login to Cloud9

● Go to ​ https://c9.io/web/login



Open Workspace

● Click OPEN on your ​ ruby-on-rails​ workspace tile



Make Sure You Are In Your Workspace Directory

● The command-line should show (substitute your own username for ​ bobleeswagger​ ):

Install Rails

● Use the ​ gem​ command provided by the RubyGems package manager:



bobleeswagger@ruby-on-rails:~/workspace $

$​ gem install rails

You should see the following: Successfully installed rails-X.X.X X gems installed





Create New Dozerslist Application

● Create a new Rails application, named ​ dozerslist​ , with a default directory structure:

Change Directory to New Application

● The ​ rails​ command created a directory for your application; change directory, i.e., ​ cd​ , to it:

$​ rails new dozerslist -T --skip-turbolinks

$​ cd dozerslist



List the Contents of Application Directory

● Perform a directory listing, i.e., ​ ls​ : $​ ls -lart

Page 1 of 3

The results of the listing should resemble the following: total 68 -rw-r--r-- 1 ubuntu ubuntu 249 Jul 19 00:30 Rakefile -rw-r--r-- 1 ubuntu ubuntu 478 Jul 19 00:30 README.rdoc drwxrwxr-x 4 ubuntu ubuntu 4096 Jul 19 00:30 ../ -rw-r--r-- 1 ubuntu ubuntu 153 Jul 19 00:30 config.ru -rw-r--r-- 1 ubuntu ubuntu 1345 Jul 19 00:30 Gemfile -rw-r--r-- 1 ubuntu ubuntu 474 Jul 19 00:30 .gitignore drwxr-xr-x 8 ubuntu ubuntu 4096 Jul 19 00:30 app/ drwxr-xr-x 4 ubuntu ubuntu 4096 Jul 19 00:30 lib/ drwxr-xr-x 2 ubuntu ubuntu 4096 Jul 19 00:30 db/ drwxr-xr-x 5 ubuntu ubuntu 4096 Jul 19 00:30 config/ drwxr-xr-x 2 ubuntu ubuntu 4096 Jul 19 00:30 log/ drwxr-xr-x 3 ubuntu ubuntu 4096 Jul 19 00:30 vendor/ drwxr-xr-x 3 ubuntu ubuntu 4096 Jul 19 00:30 tmp/ drwxr-xr-x 2 ubuntu ubuntu 4096 Jul 19 00:30 public/ -rw-r--r-- 1 ubuntu ubuntu 3772 Jul 19 00:31 Gemfile.lock drwxr-xr-x 11 ubuntu ubuntu 4096 Jul 19 00:31 ./ drwxr-xr-x 2 ubuntu ubuntu 4096 Jul 19 00:31 bin/



Launch a New Terminal

● Click the green plus icon to launch a new command-line terminal

This will be ​ used exclusively for running the Rails server and viewing any messages it outputs to the screen ❏

Start the Rails Server

● Change directory to ​ dozerslist​ , your application’s directory: $​ cd dozerslist

● Launch the Rails server: $​ rails s -b $IP -p $PORT

You should see output similar to the following: => Booting WEBrick => Rails 4.2.3 application starting in development on http://0.0.0.0:8080 => Run `rails server -h` for more startup options => Ctrl-C to shutdown server [2015-07-19 00:44:46] INFO WEBrick 1.3.1

Page 2 of 3

[2015-07-19 00:44:46] INFO ruby 2.2.1 (2015-02-26) [x86_64-linux] [2015-07-19 00:44:46] INFO WEBrick::HTTPServer#start: pid=1596 port=8080



Verify the Application is Running

● In your browser, go to the URL specified in the Cloud9 pop-up

You should see the Welcome aboard message:



Go to the Filesystem Navigator

● Before moving on, navigate to the project’s directory in the filesystem navigator



Save and Close the Project

● FILE Menu > Save All ● Cloud9 > Quit Cloud9

Page 3 of 3