Pry-Remote with Pow on Rails 4

I'm busy (finally) upgrading to Rails 4 and I am having a problem with Pry-remote.

Problem:

When adding binding.remote_pry to my code, it breaks the code, but when I cannot get into the debugger by typing pry-remote . This was used when working with Rails 3 and Ruby 1.9.3.

Side note:

When starting Rails s instead of Pow and binding.pry instead of binding.remote_pry it gets into the debugger.

What I run:

  • 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 using 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

+5
source share
2 answers

I had a similar problem, like you, probably the same one. I was able to solve the problem by removing the pry-byebug (version 3.1.0 before removal).

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

What I use (for comparison):

  • Pow 0.5.0
  • ruby 2.2.1p85
  • Rails 4.2.0
  • OSX 10.10.2
+1
source

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 remote console, I could not see any return value and had to manually do something like this:

 Pry.config.print = Proc.new { |output, val| output.puts "=> #{val.inspect}" } 
+1
source

Source: https://habr.com/ru/post/1213614/


All Articles