4

I have foreman starting multiple apps. I have set up byebug server with a port

#config/initializers/byebug.rb
if Rails.env.development?
  require 'byebug/core'
  #Byebug.wait_connection = true

  def find_available_port
    server = TCPServer.new(nil, 0)
    server.addr[1]
  ensure
    server.close if server
  end

  port = find_available_port

  puts "Starting remote debugger..."
  Byebug.start_server nil, port
  puts "Remote debugger on port #{port}"
end

I start service with

$ foreman start

I see the service start and port number reported in terminal:

21:20:58 web.1       | => Ctrl-C to shutdown server
21:20:58 web.1       | Starting remote debugger...
21:20:58 web.1       | Remote debugger on port 54635

I fire up byebug with remote option and all I get is this:

$ byebug -R localhost:54635
Connecting to byebug server...
Connected.

And that's my problem. "Connected." but no byebug prompt. Also, the breakpoint I'm after seems to fire but byebyg remote debugging does nothing more.

Ideas? Anyone? Because I've searched everythere and nobody seems having a similar problem.

My system parameters:

  • OS X El Capitan 10.11.2
  • ruby 2.2.3
  • rails 4.1.14
  • byebug 8.2.1
  • foreman 0.78.0
jannolii
  • 86
  • 2
  • 9
  • Probably something to do with this: [https://github.com/deivid-rodriguez/byebug/issues/141](https://github.com/deivid-rodriguez/byebug/issues/141) – Jason Kotchoff Mar 09 '16 at 00:51

1 Answers1

0

I can confirm @jannolii's concept working as of this byebug commit. Also, I uncommented:

Byebug.wait_connection = true

Everything else you had seems to work. Update the byebug gem to 10.0 and I think you're going to be in luck. :)

mhaliski
  • 85
  • 4