deivid-rodriguez/pry-byebug

PR proposition : Deprecated - Pry.config.control_d_handler

thibpoullain opened this issue · 6 comments

Hi,

I'm on rails 7.0.1 and ruby 3.0.3, using pry-byebug 3.9.0.

I got this warning on my rails server command :

/Users/thibaut/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/pry-byebug-3.8.0/lib/pry-byebug/control_d_handler.rb:5: warning: control_d_handler's arity of 2 parameters was deprecated (eval_string, pry_instance). Now it gets passed just 1 parameter (pry_instance)

I checked the file, this is the original :

control_d_handler.rb:5

original_handler = Pry.config.control_d_handler

Pry.config.control_d_handler = proc do |eval_string, pry_instance|
  Byebug.stop if Byebug.stoppable?

  original_handler.call(eval_string, pry_instance)
end

I suggest this (works for me) :

control_d_handler.rb:5

original_handler = Pry.config.control_d_handler

Pry.config.control_d_handler = proc do |pry_instance|
  Byebug.stop if Byebug.stoppable?

  original_handler.call(pry_instance)
end

What do you think ?

23tux commented

Is there any news on this?

I have same issue with rails version 6.1.4

Hi,
I have same issue with Rails 6.1.4, Ruby 3.0.
Any Progress?

kzq commented

I updated the gem to 3.9.0 where they have fixed the issue
https://github.com/deivid-rodriguez/pry-byebug/blob/master/lib/pry-byebug/control_d_handler.rb

but this version of gem is not compatible with latest version of pry as getting the error below

Bundler could not find compatible versions for gem "pry":
  In snapshot (Gemfile.lock):
    pry (= 0.14.1)

  In Gemfile:
    pry

    pry-byebug (~> 3.9.0) was resolved to 3.9.0, which depends on
      pry (~> 0.13.0)

Running `bundle update` will rebuild your snapshot from scratch, using only
the gems in your Gemfile, which may resolve the conflict.

Just for info if you are using Rails 7 then remove these gems and use built in debugger
https://guides.rubyonrails.org/debugging_rails_applications.html#entering-a-debugging-session

This should be fixed now by the recent releases!