rails server specify port code example
Example 1: start rails server on different port
rails s -p 5000 #or you can set your own port (> 1024)
Example 2: rails server set default port and ip
require 'rails/commands/server'
module Rails
class Server
def default_options
super.merge(Host: '0.0.0.0', Port: 3000)
end
end
end