Pry-Remote with Pow on Rails 4
Asked Answered
I

2

6

I'm busy with (finally) upgrading to Rails 4 and I've run into a problem with Pry-remote.

Problem:

When added binding.remote_pry to my code it breaks the code but when I can't get into the debugger by typing pry-remote. This used to work when running Rails 3 and Ruby 1.9.3.

Side note:

When running Rails s instead of Pow and binding.pry instead binding.remote_pry , it falls into the debugger.

What I'm running:

  • Pow 0.5.0
  • ruby 2.1.5p273
  • Rails 4.2.0
  • OSX 10.9.5

Gemfile

gem 'pry'
gem 'pry-remote'
gem 'pry-stack_explorer'
gem 'pry-rails'
gem 'byebug'
gem 'pry-byebug'

Gemfile.lock

pry (0.10.1)
  coderay (~> 1.1.0)
  method_source (~> 0.8.1)
  slop (~> 3.4)
pry-byebug (3.0.1)
  byebug (~> 3.4)
  pry (~> 0.10)
pry-rails (0.3.3)
  pry (>= 0.9.10)
pry-remote (0.1.8)
  pry (~> 0.9)
  slop (~> 3.0)
pry-stack_explorer (0.4.9.2)
  binding_of_caller (>= 0.7)
  pry (>= 0.9.11)

EDIT 1: Also tried with Specs and without pry-byebug

  • Pow 0.5.0
  • ruby 2.2.1p85
  • Rails 4.1.6
  • OSX 10.9.5

--> Returns http://pastie.org/10054841

Inhospitality answered 18/2, 2015 at 13:17 Comment(0)
R
1

I ran into a similar issue as you, maybe the same one. I was able to resolve it by uninstalling the pry-byebug gem (version 3.1.0 before the uninstall).

If you want to give this a try, you can remove the gem from your Gemfile and run bundle install. You may also need to restart your Pow server using touch tmp/restart.txt.

What I'm running (for comparison):

  • Pow 0.5.0
  • ruby 2.2.1p85
  • Rails 4.2.0
  • OSX 10.10.2
Reni answered 25/3, 2015 at 9:15 Comment(2)
Hi Randall! That works for me only problem is that I can't do next or continue anymore, it returns the following errors: pastie.org/10054841 also notice edit 1 for my specs.Inhospitality
Right, the pry-byebug gem provides this functionality. Hopefully the issue will be corrected soon, but in the mean time I'll sacrifice those commands for the ability to step into code at all.Reni
L
1

In your gemfile try: gem 'pry-byebug', '~> 1.3.3'

With pry-byebug 1.3.3 I was able to get pry-remote to work. However in the pry-remote console I was not able to see any return value and had to manually do something like this:

Pry.config.print = Proc.new { |output, val| output.puts "=> #{val.inspect}" }
Laster answered 28/6, 2015 at 22:45 Comment(1)
This is currently the correct fix because it's a known & unresolved issue github.com/deivid-rodriguez/pry-byebug/issues/33Concurrence

© 2022 - 2024 — McMap. All rights reserved.