Search code examples
ruby-on-railscloud9-ide

How does a rails server know which route.rb to use?


I'm currently learning rails following this tutorial: https://www.railstutorial.org/book/beginning#sec-the_hello_application

Here's what I've done.

  1. Create a new workspace in Cloud9.
  2. Use the rails new hello_world to create a new rails application.
  3. From there configure routes.rb, application_controller.rb etc.
  4. Create a new application in the same work space using rails new sample_app
  5. Muck around changing stuff here as well.
  6. Change to the hello_world directory, our directory is /workspace/hello_world.
  7. Open new terminal, run rails server -b $IP -p $PORT
  8. This successfully deploys a webapp, but when I access it shows the application from my sample_app application.

How do I specify which application I want to deploy?


Solution

  • Make sure you are in the right directory. You have created two applications in the same directory, so make sure you are starting the server from /workspace/hello_world