Pry-Remote not triggered Rails 4

2020-04-10 02:39发布

问题:

Problem:

After upgrading to Rails 4 in another branch and trying the solution that worked last time Pry-Remote with Pow on Rails 4 . I'm still finding difficulty with the new Rails 4 and Pry Debugger.

What's I'm running:

rvm 1.26.11 (latest) by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.io/]
ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-darwin14]
Rails 4.2.4
Pry version 0.10.2 on Ruby 2.2.3

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

pry (0.10.2)
  coderay (~> 1.1.0)
  method_source (~> 0.8.1)
  slop (~> 3.4)
pry-byebug (3.2.0)
  byebug (~> 5.0)
  pry (~> 0.10)
pry-rails (0.3.4)
  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)

Mac OS X 10.10.5 (14F27)

Latest version from Pow

Full Gemfile and Gemfile.lock

Symptoms:

Putting binding.remote_pry in the code the code is halting but unable to go into the debugger. Debugger stays "loading" after I type pry-remote.

First pry-remote: Debugger not ready.

Second pry-remote: No answer

Third pry-remote: Keeps loading without output

Fourth pry-remote: Output when CTRL + C

EDIT 1:

So following the suggested post ( https://github.com/Mon-Ouie/pry-remote/issues/8 ).

I've done and tried the following:

  • Created .prv file with:

    Pry.config.correct_indent = false

    Pry.config.auto_indent = false

  • Added "require 'pry-remote'" to main.rb

  • Not running Unicorn or Nginx, so no need to update those

  • Updated Gemfile to gem "pry-remote", :require => "pry-remote"

So with all these things done, still no difference.

Edit 2:

With the help of Alexey Shein, I have moved a step further. Now he goes into the debugger but I can't use next and step.

Edit 3:

Pry-Byebug Issue created: https://github.com/deivid-rodriguez/pry-byebug/issues/78

Edit 4: Split this post into Pry Remote / ByeBug next goes into Teardown because I think this issue is more related to ByeBug then Pry-remote.

回答1:

Try pry-byebug with version 1.3.3. It seems pry-byebug author lost interest to his project, so you may need to downgrade to an older but more stable version. I'd do the following:

# remove pry from Gemfile, it will be explicitly loaded by dependency of pry-byebug
# gem 'pry'     
gem 'pry-byebug', '=1.3.3'
gem 'pry-stack_explorer'
gem 'pry-rails'
gem 'pry-remote'
# remove also `byebug`, it may give too high version of byebug than needed by pry-byebug
# gem 'byebug' 

Now run bundle install. After that try to start pow cleanly, i.e. restart/kill all spring and pow processes.

$ spring stop # graceful spring stop
$ ps ax | grep '[s]pring' | awk '{ print $1 }' | xargs kill -9 # force spring to quit
$ touch ~/.pow/restart.txt # restart pow