5

I'm looking for some suggestions on a tool similar to using binding.pry.

I'm serving a rails app locally with foreman and would like to accomplish the same ability to put "debuggers" in my code and when the process hits that, freeze and open a console environment in that section of the code.

I've tried using pry with foreman to no avail and was curious if there are other known tools I'm not finding through google?

Thanks for the suggestions.

Lowell Mower
  • 313
  • 4
  • 14

1 Answers1

3

Try pry-remote, it seems to be the answer of running Pry with Foreman.

Checklist:

  1. Make sure you're using binding.remote_pry instead of binding.pry.
  2. Make sure to run your program making binding.remote_pry first and then run in console remote-pry, otherwise the pry server won't be running.
  3. If nothing helps, try adding require 'pry-remote' at the top of your .rb file.
  4. Check also this issue.
Alexey Shein
  • 7,342
  • 1
  • 25
  • 38
  • Cannot use the same IP address for both foreman and pry remote – Lowell Mower Sep 19 '15 at 18:19
  • Could you elaborate on that in your question? Do you get any error message? What's your setup? – Alexey Shein Sep 19 '15 at 18:23
  • Sure, so I'm using foreman to serve up my website and 3 unicorn workers which are running on localhost port 5000 pry is throwing the following error: rescue in block in open': druby://127.0.0.1:9876 - # - - this is in the command line while in the app the following error reads: Address already in use - bind(2) for "127.0.0.1" port 9876 – Lowell Mower Sep 19 '15 at 19:33
  • I should also note ruby v 2.1.3 and rails 4 – Lowell Mower Sep 19 '15 at 19:40
  • Did you use `binding.remote_pry` instead of `binding.pry`? – Alexey Shein Sep 19 '15 at 19:42
  • yes, I did. I've simply decided not to use foreman in development and to just use rails server instead. – Lowell Mower Sep 20 '15 at 18:17
  • I'm still experiencing this issue, please look at my post. http://stackoverflow.com/questions/32780971/pry-remote-not-triggered-rails-4 – FastSolutions Sep 28 '15 at 07:14