0

Is it possible to run same project or application in different port ? Suppose, I have project/application Blog, I want to run in this project at once in two different port. When I run server i.e rails server , then it run in port 3000. Again, in next terminal tap, I try to same project but in different port i.e rails server -p 3001 but it doesn't run ?

Is there any other way to run same project in different in different port at localhost sever ?

Rajdeep Singh
  • 17,621
  • 6
  • 53
  • 78
Amrit Dhungana
  • 4,371
  • 5
  • 31
  • 36
  • @RSB I think stackoverflow is not for revenge. Try to be more clear about it before you are doing anythings – Amrit Dhungana May 15 '14 at 09:43
  • 4
    http://stackoverflow.com/questions/15127412/ror-a-server-is-already-running-check-tmp-pids-server-pid-exiting – Nithin May 15 '14 at 09:46
  • @Santosh But I have work on same project. IOS developer is working same project. So for them I have make my server running at localhost and I am working on it and I want to work in next port. – Amrit Dhungana May 15 '14 at 09:46
  • I tried helping you, you wrote `rails sever` instead of `rails server`, I had mentioned that in my answer, check the spelling in your question – Rajdeep Singh May 15 '14 at 09:48
  • @RSB check out the question below. Don't try to be over smart dude. – Amrit Dhungana May 15 '14 at 09:55
  • Yes I can see the edit, now it looks fine. Please go through this link, you will get to know how to ask a good question http://stackoverflow.com/help/how-to-ask – Rajdeep Singh May 15 '14 at 10:00

1 Answers1

7

Rails uses the pid of your running server to check whether a server is already running or not.

This is stored under tmp/pids/server.pid If you want to run the same application again (why but?), you need a different pid for your server.

rails s -p 4000 --pid tmp/pids/server2.pid
manu29.d
  • 1,538
  • 1
  • 11
  • 15
  • 2
    I see a new comment below your question that shows a duplicate question. You should've searched stackoverflow extensively before giving bad attitude to people. – manu29.d May 15 '14 at 10:05