diff --git a/lib/webpacker/dev_server.rb b/lib/webpacker/dev_server.rb index d9dae3447..c002ec5a7 100644 --- a/lib/webpacker/dev_server.rb +++ b/lib/webpacker/dev_server.rb @@ -13,7 +13,7 @@ def initialize(config) def running? if config.dev_server.present? - Socket.tcp(host, port, connect_timeout: connect_timeout).close + Timeout.timeout(connect_timeout) { Socket.tcp(host, port).close } true else false diff --git a/lib/webpacker/dev_server_runner.rb b/lib/webpacker/dev_server_runner.rb index 0ce83623c..b709be868 100644 --- a/lib/webpacker/dev_server_runner.rb +++ b/lib/webpacker/dev_server_runner.rb @@ -1,5 +1,6 @@ require "shellwords" require "socket" +require "timeout" require "webpacker/configuration" require "webpacker/dev_server" require "webpacker/runner"