Debugging Unicorn server remotely with RubyMine

1.6k Views Asked by At

I have Rails (version 4.0.3) application which uses nginx as front-end server to dispatch the requests to actual Unicorn. Whilst developing the app I would like to use Docker on Windows (boot2docker) to run the application and ruby-debug-ide to debug the application remotely.

The original setup works fine (application answers on the host machine) until I replace rails server with

rdebug-ide --port 1234 --host 0.0.0.0 --dispatcher-port 26162 -- bin/rails server

After running this on the Docker container I connect to the remote debugger successfully as it tells on Docker containers bash that breakpoints were added based on what I've set on RubyMine and tells that Unicorn server is now running. I added gem unicorn-rails to make rails server work for Unicorn too.

Now the actual problem is that the nginx can't seem to find the Unicorn when it as ran within the debugger. It just keeps on loading on browser (and with curl) until 504 (gateway timeout) is returned.

The interesting Unicorn configuration contains

app_dir = "/app"
working_directory app_dir
pid "#{app_dir}/tmp/unicorn.pid"
worker_processes 1
listen "/tmp/unicorn.sock", :backlog => 64

I have set up everything as described on JetBrains help pages. On Docker I have all the necessary ports (1234 for debugger, 26162 for dispatcher, 443 for HTTPS) open.

I've crawled Internet and Stack Overflow for hours without any luck and can't find anything to try anymore. Any ideas?

0

There are 0 best solutions below