From 306c14c41135dc8d308967821d0bb26cf4bb7ecd Mon Sep 17 00:00:00 2001 From: David Cornu Date: Mon, 17 Aug 2015 18:02:35 +0000 Subject: Use the PORT environment variable for rails server --- railties/lib/rails/commands/server.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'railties/lib/rails') diff --git a/railties/lib/rails/commands/server.rb b/railties/lib/rails/commands/server.rb index c8fb58ab05..d3ea441f8e 100644 --- a/railties/lib/rails/commands/server.rb +++ b/railties/lib/rails/commands/server.rb @@ -86,7 +86,7 @@ module Rails def default_options super.merge({ - Port: 3000, + Port: ENV.fetch('PORT', 3000).to_i, DoNotReverseLookup: true, environment: (ENV['RAILS_ENV'] || ENV['RACK_ENV'] || "development").dup, daemonize: false, -- cgit v1.2.3