How to set default port for webrick?

I want to set the default port when I do

rails s 

to 3010, instead of saying:

 rails s -p 3010 

... everytime. Any ideas?

+7
source share
1 answer

You can override Port by adding the following code to config/boot.rb

 require 'rails/commands/server' module Rails class Server alias :default_options_alias :default_options def default_options default_options_alias.merge!(:Port => 3010) end end end 
+10
source

All Articles