If you’ve ever needed to run two rails servers at the same time this post is for you. Every day for the past few months I’ve been working on a personality test for major finder. I created the personality test as a rails engine. I then plugged the personality test into majorfinder. I am therefore working closely with two separate applications essentially. I also am doing a few things on this site, lauraleeflores.com, which is also a rails app. I am constantly starting up more than one rails servers at the same time.
You may experience something like this too. If so, you'll find it incredibly easy. Here's all you have to do.
To start the first rails server you just go to your application root directory and then type
rails server or
rails s in order to start the first one. This will start your server so that when you go to your browser and type in http://localhost:3000/ you’re up and running.
Once you have that server running you go to a new command line window and go to the second application you want to run and type
rails s -p 4000. This is just saying rails server on port 4000 (instead of the default 3000).
It's that easy. Now you can be up and running two different application servers one on http://localhost:3000 and another on http://localhost:4000/!
Here's a video walking you through how to run two rails servers: