Other Pages

Expand All

running_your_application_locally.step

goals do
  goal "Let's fire up the application locally"
end
steps do
  step do
    tip do
      message "On Linux, you may have to enable this line in your Gemfile:"
      pre "gem 'therubyracer', :platforms => :ruby"
      message "Just delete the '#' in front of the statement, then save the file. All that is left is to do a bundle install"
      console "bundle install"
    end
    console "rails server"
  end
  step do
    text "Point your web browser to "
    url "http://localhost:3000" 
    p "See your web app actually running!"
  end
  step do
    message "When at the terminal with your running rails server, type **Control-C** to stop rails server. You can do this now."
    result <<-STOPPING_RAILS_SERVER
^C[2022-03-31 08:33:11] INFO  going to shutdown ...
[2022-03-31 08:33:11] INFO  WEBrick::HTTPServer#start done.
Exiting
    STOPPING_RAILS_SERVER
  end
end
explanation do
  message "`rails server` ran your application locally just like Heroku will be running it on their servers. A web server is the hardware (or software) that delivers content to you."
  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"

If you find something that could be improved, please make a pull request or drop us a note via GitHub Issues (no technical knowledge required).

Source: https://github.com/RailsBridge-CapeTown