Cannot start localhost: 3000: a blank white page is displayed

I am using Rails 4.2.6 and Ruby 2.3.0 and Puma 3.3.0. Over the past two days I have been running some package updates, and after the rails all browsers for the same localhost: 3000 URL display the same blank page . This corresponds to all 6-7 applications that I play with. However, they all work in production when deployed to Heroku. This seems to be just a question related to my dev env.

I don’t know how to solve this. Any help would be much appreciated. You cannot continue development if you cannot run unit tests of the code that I am developing.

However, everything works well when I use a different port. For example, when starting an application server using the rails s -p 3001 or port 3002 commands, I have no problem running applications in any browser using the localhost: 3001 or localhost: 3002 URL.

What is wrong with my port 3000 or Puma or both?

+6
source share
1 answer

This can happen locally in dev and never "prod", i.e. Heroku due to an error while stopping Puma. Sometimes some processes are not killed due to:

levi-test-01 liviu-mac $ rails s => Booting Puma => Rails 4.2.6 application starting in development on http://localhost:3000 => Run `rails server -h` for more startup options => Ctrl-C to shutdown server [4589] Puma starting in cluster mode... [4589] * Version 3.3.0 (ruby 2.3.0-p0), codename: Jovial Platypus [4589] * Min threads: 5, max threads: 5 [4589] * Environment: development [4589] * Process workers: 2 [4589] * Preloading application [4589] * Listening on tcp://localhost:3000 [4589] Use Ctrl-C to stop [4589] - Worker 1 (pid: 4603) booted, phase: 0 [4589] - Worker 0 (pid: 4602) booted, phase: 0 ^C[4589] - Gracefully shutting down workers... /Users/liviu-mac/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rack-1.6.4/lib/rack/server.rb:355:in `delete': No such file or directory @ unlink_internal - /Users/liviu-mac/ror/levi-test-01/tmp/pids/server.pid (Errno::ENOENT) from /Users/liviu-mac/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rack-1.6.4/lib/rack/server.rb:355:in `block in write_pid' from /Users/liviu-mac/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/puma-3.3.0/lib/puma/cluster.rb:120:in `fork' from /Users/liviu-mac/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/puma-3.3.0/lib/puma/cluster.rb:120:in `block in spawn_workers' from /Users/liviu-mac/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/puma-3.3.0/lib/puma/cluster.rb:116:in `times' from /Users/liviu-mac/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/puma-3.3.0/lib/puma/cluster.rb:116:in `spawn_workers' from /Users/liviu-mac/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/puma-3.3.0/lib/puma/cluster.rb:418:in `run' from /Users/liviu-mac/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/puma-3.3.0/lib/puma/launcher.rb:172:in `run' from /Users/liviu-mac/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/puma-3.3.0/lib/rack/handler/puma.rb:51:in `run' from /Users/liviu-mac/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rack-1.6.4/lib/rack/server.rb:286:in `start' from /Users/liviu-mac/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-4.2.6/lib/rails/commands/server.rb:80:in `start' from /Users/liviu-mac/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-4.2.6/lib/rails/commands/commands_tasks.rb:80:in `block in server' 

Running such a command:

 levi-test-01 liviu-mac $ lsof -i :3000 

lists all remaining processes using port 3000 .

Team like

 levi-test-01 liviu-mac $ kill -9 PID 

solves the problem.

+12
source

All Articles