Other Pages

Expand All

running_your_application_locally.step

goals do
  goal "Let's fire up the application locally"
end


steps do
  step do
    message "Make sure that you're in the `suggestotron` folder. You can type `pwd` (**p**rint **w**orking **d**irectory) in the terminal to see what folder you are in."

    console "rails server"
    message "This will print some stuff and stay running forever, printing more stuff
every time you visit a page in your app."
  end
  step do
    text "Point your web browser to "
    url "http://localhost:3000"
    message "See your web app actually running!"
  end

  step do
    message "While the server is running, whatever you type in that terminal tab
will be ignored."
    message "To get back to the terminal, you can stop the server by typing
`Control-c`."
    result <<-STOPPING_RAILS_SERVER
^CExiting
    STOPPING_RAILS_SERVER
  end
end

explanation do
  message "`rails server` ran your application locally just like Heroku will be running it on their servers."
  message "This provides a very simple means to see your changes before you commit and push them to Heroku."
  message "`Control-c` is a way of closing or cancelling terminal programs. Since
`rails server` runs forever, you need to interrupt it with `Control-c`."
end

next_step "creating_a_migration"