Starting multiple instances of WEBrick server from the command line
Posted by arjunghosh on September 6, 2007
As i mentioned in my previous log on starting WEBrick server manually from command line, here i look into the often asked question about starting Multiple instances of WEBrick server at the same time so that multiple Rails application can be run at the same time.
So continuing from my prev log…
Suppose we have to run another test called “AnotherTestRailsApp” beside “TestRailsApp” already running on our machine.
1. Now type the command
ruby script/server -p3001
“c:\AnotherTestRailsApp> ruby script/server -p9001”
2. Now to also run “AnotherTestRailsApp” rails app can be accessed by going to the address bar of your browser and typing the command at the address bar:
So here the above Rails app “AnotherTestRailsApp” is running on port 3001 instead of default 3000. This number can be any thing like 3010 or 9000.
3. So we now have one rails app “TestRailsApp” running at port 3000 and another “AnotherTestRailsApp” rails app running at port 3001