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

Error using step or next #9

Closed
manuelmeurer opened this issue Sep 24, 2013 · 14 comments
Closed

Error using step or next #9

manuelmeurer opened this issue Sep 24, 2013 · 14 comments

Comments

@manuelmeurer
Copy link

I'm getting the following error when using step or next:

    17:         code
 => 18: binding.pry
    19:         code

[1] myapp(#<Services::Widgets::FillLocale>)> s
undefined method `repl' for nil:NilClass
/Users/manuel/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/pry-byebug-1.2.0/lib/pry-byebug/processor.rb:113:in `block in resume_pry'
/Users/manuel/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/pry-byebug-1.2.0/lib/pry-byebug/processor.rb:19:in `block in run'
/Users/manuel/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/pry-byebug-1.2.0/lib/pry-byebug/processor.rb:18:in `catch'
/Users/manuel/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/pry-byebug-1.2.0/lib/pry-byebug/processor.rb:18:in `run'
/Users/manuel/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/pry-byebug-1.2.0/lib/pry-byebug/processor.rb:112:in `resume_pry'
/Users/manuel/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/pry-byebug-1.2.0/lib/pry-byebug/processor.rb:80:in `at_line'
/Users/manuel/.rbenv/gems/2.0.0/gems/byebug-2.2.1/lib/byebug/context.rb:74:in `at_line'
/Users/manuel/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/pry-byebug-1.2.0/lib/pry-byebug/processor.rb:20:in `block in run'
/Users/manuel/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/pry-byebug-1.2.0/lib/pry-byebug/processor.rb:18:in `catch'
/Users/manuel/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/pry-byebug-1.2.0/lib/pry-byebug/processor.rb:18:in `run'

Exception: NoMethodError: undefined method `repl' for nil:NilClass
--
From: /Users/manuel/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/pry-byebug-1.2.0/lib/pry-byebug/processor.rb @ line 113 @ level: 0 of backtrace (of 71).

    108:       def resume_pry(context)
    109:         new_binding = context.frame_binding(0)
    110:         Byebug.stop unless @always_enabled
    111: 
    112:         run(false) do
 => 113:           @pry.repl new_binding
    114:         end
    115:       end
    116: 
    117:       # Cleanup when debugging is stopped and execution continues.
    118:       def stop

Using Rails 3.2.14, Ruby 2.0.0p247, Pry 0.9.12.2, pry-byebug 1.2.0, byebug 2.2.1

@deivid-rodriguez
Copy link
Owner

Hi @manuelmeurer ! Thanks for the report. I'm sorry to release buggy versions like this, but pry-byebug is not extensively tested (the test suite has been recently added) and I don't really know the code that well yet...

Anyways, does this happen all the time? Do you have a reproducible app/script I can try? I've been using it in one of my apps (Rails 4.0.0) and also I just tried it in a toy example (no Rails) and it worked fine.

@manuelmeurer
Copy link
Author

No need to apologize, it's great to have you working on this!
Yes, it happens all the time, but unfortunately I don't have a small app for you to try, the one I'm working on is quite big and has lots of dependencies.
It seems like @pry does not get set properly over here: https://github.com/deivid-rodriguez/pry-byebug/blob/master/lib/pry-byebug/processor.rb#L27
If you can't figure it out, we can just leave this issue open for now, maybe it will sort itself out.

@deivid-rodriguez
Copy link
Owner

I tried this with rails 3.2.14 and I can't reproduce it either. Leaving this open until someone hits it again...

Cheers!

@benjiwheeler
Copy link

I'm hitting this same problem. Let me see if I can isolate it for you.

@deivid-rodriguez
Copy link
Owner

Would you be able to try reproduce this using ruby 2.1.0 + the patch provided in the following issue: https://bugs.ruby-lang.org/issues/9321#change-44189?

Not sure about other ruby managers, but to install it using rvm, do

git clone git://github.com/ruby/ruby.git
cd ruby
git format-patch -1 c2e72fb
rvm reinstall 2.1.0 --patch 0001-vm.c-rb_vm_pop_cfunc_frame-added.-It-cares-c_return-.patch

I think this issue might get resolved with that patch.

@benjiwheeler
Copy link

was using 2.0.0 and 4.0.0
just going to ruby "2.1.0"/gem 'rails', '4.0.2'
fixed the problem.
thanks!

-Ben


Ben Wheeler
mobile 917.254.1578

On Fri, Jan 10, 2014 at 3:57 AM, David Rodríguez
notifications@github.comwrote:

Would you be able to try reproduce this using ruby 2.1.0 + the patch
provided in the following issue:
https://bugs.ruby-lang.org/issues/9321#change-44189?

Not sure about other ruby managers, but to install it using rvm, do

git clone git://github.com/ruby/ruby.git
cd ruby
git format-patch -1 c2e72fb
rvm reinstall 2.1.0 --patch 0001-vm.c-rb_vm_pop_cfunc_frame-added.-It-cares-c_return-.patch

I think this issue might get resolved with that patch.


Reply to this email directly or view it on GitHubhttps://github.com//issues/9#issuecomment-32011902
.

@benjiwheeler
Copy link

although now i get:
undefined method `interface' for #PryByebug::Processor:0x007fb8bf615150

-Ben


Ben Wheeler
mobile 917.254.1578

On Sat, Jan 11, 2014 at 10:19 AM, Benjamin Wheeler <
wheeler.benjamin@gmail.com> wrote:

was using 2.0.0 and 4.0.0
just going to ruby "2.1.0"/gem 'rails', '4.0.2'
fixed the problem.
thanks!

-Ben


Ben Wheeler
mobile 917.254.1578

On Fri, Jan 10, 2014 at 3:57 AM, David Rodríguez <notifications@github.com

wrote:

Would you be able to try reproduce this using ruby 2.1.0 + the patch
provided in the following issue:
https://bugs.ruby-lang.org/issues/9321#change-44189?

Not sure about other ruby managers, but to install it using rvm, do

git clone git://github.com/ruby/ruby.git
cd ruby
git format-patch -1 c2e72fb
rvm reinstall 2.1.0 --patch 0001-vm.c-rb_vm_pop_cfunc_frame-added.-It-cares-c_return-.patch

I think this issue might get resolved with that patch.


Reply to this email directly or view it on GitHubhttps://github.com//issues/9#issuecomment-32011902
.

@benjiwheeler
Copy link

i use rbenv, can't figure out how to use patch.

-Ben


Ben Wheeler
mobile 917.254.1578

On Sat, Jan 11, 2014 at 10:20 AM, Benjamin Wheeler <
wheeler.benjamin@gmail.com> wrote:

although now i get:
undefined method `interface' for #PryByebug::Processor:0x007fb8bf615150

-Ben


Ben Wheeler
mobile 917.254.1578

On Sat, Jan 11, 2014 at 10:19 AM, Benjamin Wheeler <
wheeler.benjamin@gmail.com> wrote:

was using 2.0.0 and 4.0.0
just going to ruby "2.1.0"/gem 'rails', '4.0.2'
fixed the problem.
thanks!

-Ben


Ben Wheeler
mobile 917.254.1578

On Fri, Jan 10, 2014 at 3:57 AM, David Rodríguez <
notifications@github.com> wrote:

Would you be able to try reproduce this using ruby 2.1.0 + the patch
provided in the following issue:
https://bugs.ruby-lang.org/issues/9321#change-44189?

Not sure about other ruby managers, but to install it using rvm, do

git clone git://github.com/ruby/ruby.git
cd ruby
git format-patch -1 c2e72fb
rvm reinstall 2.1.0 --patch 0001-vm.c-rb_vm_pop_cfunc_frame-added.-It-cares-c_return-.patch

I think this issue might get resolved with that patch.


Reply to this email directly or view it on GitHubhttps://github.com//issues/9#issuecomment-32011902
.

@deivid-rodriguez
Copy link
Owner

I think you need to install ruby-build as an rbenv plugin and then a quick look to the ruby-build's README tells me something like this should work

git clone git://github.com/ruby/ruby.git
cd ruby
git format-patch -1 c2e72fb
rbenv install --patch 2.1.0 < 0001-vm.c-rb_vm_pop_cfunc_frame-added.-It-cares-c_return-.patch

But I don't use rbenv so I haven't tried it.

@benjiwheeler
Copy link

can't figure it out... i'm getting
-> http://dqw8nmjcqpjn7.cloudfront.net/9e6386d53f5200a3e7069107405b93f7
Installing ruby-2.1.0...
can't find file to patch at input line 30
Perhaps you used the wrong -p or --strip option?

The text leading up to this was:

|From c2e72fb34302e444f6cc4c6477877e36902a7035 Mon Sep 17 00:00:00 2001
|From: ko1 ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|Date: Thu, 9 Jan 2014 10:12:59 +0000
|Subject: [PATCH] * vm.c (rb_vm_pop_cfunc_frame): added. It cares c_return
| event. The patch base by drkaes (Stefan Kaes). [Bug #9321] *
variable.c
| (rb_mod_const_missing): use rb_vm_pop_cfunc_frame() instead of
| rb_frame_pop(). * vm_eval.c (raise_method_missing): ditto. * vm_eval.c
| (rb_iterate): ditto. * internal.h (rb_vm_pop_cfunc_frame): add decl. *
| test/ruby/test_settracefunc.rb: add tests. provided by drkaes (Stefan
| Kaes). * vm.c, eval.c, include/ruby/intern.h (rb_frame_pop): move
| definition of rb_frame_pop() and deprecate it. It doesn't care about
| `return' events.
|

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44535b2dd03c8-39d4-4d8f-98ff-823fe69b080e
ChangeLog
eval.c
include/ruby/intern.h
internal.h
test/ruby/test_settracefunc.rb
++++++++++++++++++++++++++++++++++++++++++
variable.c
vm.c
vm_eval.c
8 files changed, 136 insertions(+), 16 deletions(-)

|
|diff --git a/ChangeLog b/ChangeLog
|index fa8890f..f699266 100644
|--- a/ChangeLog

|+++ b/ChangeLog

File to patch: (?)

-Ben


Ben Wheeler
mobile 917.254.1578

On Sat, Jan 11, 2014 at 10:45 AM, David Rodríguez
notifications@github.comwrote:

I think you need to install ruby-build as an rbenv plugin and then a
quick look to the ruby-build's README tells me something like this should
work

git clone git://github.com/ruby/ruby.git
cd ruby
git format-patch -1 c2e72fb
rbenv install --patch 2.1.0 < 0001-vm.c-rb_vm_pop_cfunc_frame-added.-It-cares-c_return-.patch

But I don't use rbenv so I haven't tried it.


Reply to this email directly or view it on GitHubhttps://github.com//issues/9#issuecomment-32099155
.

@deivid-rodriguez
Copy link
Owner

Do some google research, or ask about this in the right place, or wait for the next patch level release of ruby....

Sorry I can't be of more help but I'm not a rbenv user...

@tomasv
Copy link

tomasv commented May 15, 2014

Not sure if this is the same case, but I had both pry-nav and pry-debug in my Gemfile. After removing pry-nav this fixed itself.

@benjiwheeler
Copy link

i'm now using
gem 'pry', group: [:development, :test]
gem 'pry-rails', group: [:development, :test]
gem 'pry-byebug', group: [:development, :test] # instead of pry-debugger
or pry-nav
gem 'pry-stack_explorer', group: [:development, :test]
and that's working fine, with ruby 2.1.0 and rails 4.1.0.

-Ben


Ben Wheeler
mobile 917.254.1578

On Thu, May 15, 2014 at 5:44 AM, Tomas Varneckas
notifications@github.comwrote:

Not sure if this is the same case, but I had both pry-nav and pry-debugin my Gemfile. After removing
pry-nav this fixed itself.


Reply to this email directly or view it on GitHubhttps://github.com//issues/9#issuecomment-43189335
.

@deivid-rodriguez
Copy link
Owner

Closing this as it seemed an incompatibility with pry-nav. Anyone still getting it, feel free to reopen.

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

No branches or pull requests

4 participants