If I specify port number separately the specified port number working.
rails s -p 3005 now its working with localhost:3005
But when i use - rails s - it running as localhost:3000.
why ruby-on-rails choosing default port is 3000.
If I specify port number separately the specified port number working.
rails s -p 3005 now its working with localhost:3005
But when i use - rails s - it running as localhost:3000.
why ruby-on-rails choosing default port is 3000.
It really doesn't matter which port (as long as it's above 1024 (those below are privileged ports and you must be root to use them).
If you don't like port 3000 you can change it How to change Rails 3 server default port in develoment?
The Rails server has a few default options, one of which is port 3000. If you don't explicitly set one of these settings, it will use the defaults defined there.
The temporary solution: />rails server -p 8080
------Complete solution
open rails application under '/config/boot.rb' add code
require 'rails/commands/server' module Rails class Server alias :default_options_alias :default_options def default_options default_options_alias.merge!(:Port => 8080) end end end
After adding above code resulting on each start of server, it will be start on port: 8080.