Creating a new Rails project

Here are the steps to create a new Rails project. All of the commands are typed through Git Bash (on Windows) or Terminal (on Mac).

Virtual Machine

Start up your virtual machine as usual: (instructions)

Change to your projects directory

From the Vagrant command line, type;

cd /vagrant/projects

Create a new Rails project

Now type:

rails new your_project_name

Change into the new directory

Type:

cd your_project_name

Create the database

Type the following to get Rails to create a blank database

bin/rake db:create

Start the Rails server

Type:

bin/rails server -b 0.0.0.0

Check it works

In your web browser, go to http://localhost:3000/

Stop the Rails server

When you are done your work, press CTRL C to stop the Rails server.

Access the Rails console

Type bin/rails console to enter the console. Type exit when you're done.







Need help? Email me: alex@dunae.ca