Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pry-rescue doesn't work correctly if pry-byebug is loaded #71

Open
abicky opened this issue Sep 21, 2014 · 11 comments · May be fixed by deivid-rodriguez/pry-byebug#187
Open

pry-rescue doesn't work correctly if pry-byebug is loaded #71

abicky opened this issue Sep 21, 2014 · 11 comments · May be fixed by deivid-rodriguez/pry-byebug#187

Comments

@abicky
Copy link

abicky commented Sep 21, 2014

pry-byebug overwrites Pry.start and pry-rescue doesn't work correctly if pry-byebug is loaded, as you can see below:

% bundle exec pry
[1] pry(main)> require './a.rb'
=> true
[2] pry(main)> foo
RuntimeError: two
from /path/to/a.rb:4:in `rescue in foo'
[3] pry(main)> cd-cause

From: /path/to/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/pry-rescue-1.4.1/lib/pry-rescue.rb @ line 207 PryRescue.with_program_name:

    202: def with_program_name name
    203:   before = $PROGRAM_NAME
    204:   $PROGRAM_NAME = name
    205:   yield
    206: ensure
 => 207:   $PROGRAM_NAME = before
    208: end

[1] pry(PryRescue)>

My Gemfile.lock is here:

GEM
  remote: https://rubygems.org/
  specs:
    byebug (3.4.0)
      columnize (~> 0.8)
      debugger-linecache (~> 1.2)
      slop (~> 3.6)
    coderay (1.1.0)
    columnize (0.8.9)
    debugger-linecache (1.2.0)
    interception (0.5)
    method_source (0.8.2)
    pry (0.10.1)
      coderay (~> 1.1.0)
      method_source (~> 0.8.1)
      slop (~> 3.4)
    pry-byebug (2.0.0)
      byebug (~> 3.4)
      pry (~> 0.10)
    pry-rescue (1.4.1)
      interception (>= 0.5)
      pry
    slop (3.6.0)

PLATFORMS
  ruby

DEPENDENCIES
  pry
  pry-byebug
  pry-rescue
@edude03
Copy link

edude03 commented Dec 9, 2014

I just ran into the same issue, is there a fix for this?

@neumachen
Copy link
Contributor

Anyone fixed this?

@hakunin
Copy link

hakunin commented Mar 25, 2015

Same problem here. Any workarounds?

@neumachen
Copy link
Contributor

I downgraded especially to 3.1

@hakunin
Copy link

hakunin commented Mar 25, 2015

Thanks for the tip. Just realised I don't have byebug in the mix at the moment :) will log as a new issue.

@gerrywastaken
Copy link

There are many issues like this caused by the fact that pry-byebug changes pry so that it advances to the next line after a breakpoint is hit. See the discussion here: deivid-rodriguez/pry-byebug#45

@mmacedo
Copy link

mmacedo commented Jul 5, 2015

@hakunin @magicalbanana Other than downgrading (3.1 is the latest version of pry-byebug, I figure @magicalbanana meant 3.0.1 or from 3.1, I am not sure), I found an alternative workaround: disabling this annoying auto-loading of plugins and then loading it manually (now I can use the executable). I'd like to register it here for people that like me arrive here unaware of this "convenience".

@skull-squadron
Copy link

Here's a patched pry 0.10.2pre to add more config tweaks (i.e., blacklisting plugins) via env vars and how to get it.

@cmrd-senya
Copy link

Works for me with pry-byebug 3.4.0 and pry-rescue 1.4.4.

@altV
Copy link

altV commented Jul 29, 2016

I have pry-byebug 3.4.0 and pry-rescue 1.4.4 - and I have the same problem with ruby 2.3.1

russelldavis pushed a commit to russelldavis/pry-rescue that referenced this issue Sep 11, 2016
In combination with https://github.com/russelldavis/pry-byebug/pull/1/files,
makes pry-rescue work when using pry-byebug.

Fixes ConradIrwin#71
@parreirat
Copy link

Still getting this as of 26/01/2017, any news?

DamienRobert pushed a commit to DamienRobert/pry-byebug that referenced this issue Jul 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants