Questions tagged [pry]

Pry is an alternative to the standard Ruby interpreter, IRB.

Pry is an REPL (Read Eval Print Loop) interpreter, allowing to access the source code and the documentation, edit methods and execute shell commands.

http://pry.github.com/

459 questions
22
votes
9 answers

Make Byebug finish executing without exiting Pry

When I set a breakpoint with Byebug in Rails, I sometimes want it to finish executing, but the guide on github says to use exit which also exits Pry. Typing continue repeatedly can be annoying if the breakpoint is in a loop. Is there anyway to…
user4970820
21
votes
4 answers

Using binding.pry in Rails app's view or partial

Pry is quite amazing in my R3 app. But any chance I can use <% binding.pry %> in a view or a partial like I did previously with <% debugger %> This doesn't seem to work. Thanks.
valk
  • 9,363
  • 12
  • 59
  • 79
21
votes
5 answers

Does an (experimental) class browser exist for Ruby?

Does an (experimental) class browser exist for Ruby? I am talking about a class browser/editor combination similar to that of most Smalltalk implementations (i.e. focused on [runtime] classes/objects instead of .rb files) P.S.: it looks like pry is…
Erik
  • 4,268
  • 5
  • 33
  • 49
19
votes
5 answers

Does a `pry` equivalent exist for php?

I'm a bit spoiled on ruby and am used to using the amazing pry facilities for apps. I'll lock an app down to 1 thread and then let pry pop open in the httpd console and then be able to get to the bottom of a lot of issues, however I am not finding…
ylluminate
  • 12,102
  • 17
  • 78
  • 152
16
votes
3 answers

How to ask ruby pry to stop all other threads

I'm trying to debug a multithreaded ruby script, the problem is when I do binding.pry The other threads continue sending output to the console. How do I make them stop at binding.pry and then start up again when I exit? I'm thinking there's a way…
pguardiario
  • 53,827
  • 19
  • 119
  • 159
16
votes
2 answers

pry-nav work unexpectedly

I put binding.pry in my script, But now when it's stopped at the breakpoint, is shows me that information. Which is out of my expectation, how to fix it ? Frame number: 0/11 From:…
user3675188
  • 7,271
  • 11
  • 40
  • 76
16
votes
5 answers

How to I start a rails console with pry turned off?

Sometimes I have reason to want to start the rails console as an irb repl rather than pry (as awesome as pry is). It will default to pry because pry has in the Gemfile. Hows is that done nowadays? I think there used to be a --irb option when…
Greg Malcolm
  • 3,238
  • 4
  • 23
  • 24
16
votes
2 answers

Getting my Ruby file to load into Pry?

I'm trying to edit my Ruby file with Pry. There are few variables that are set in it, and for whatever reason I can't seem to cd into them because they aren't being defined even after I 'load' the file. Here is the code: require 'nokogiri' require…
Nick Res
  • 2,154
  • 5
  • 30
  • 48
16
votes
2 answers

Is there a pry debug setup that works with ruby 2.0?

I'm using ruby 2.0.0-p195 on OSX. pry-debugger does not work (step/continue/next all appear to work like continue). Is there a pry debugging gem that works with ruby 2.0? update: pry-debugger and pry-byebug both appear to work with with ruby…
tee
  • 4,149
  • 1
  • 32
  • 44
15
votes
1 answer

How to step into with the rails pry debugger?

The pry-debugger is very usefull. It has the following commands : Pry.commands.alias_command 'c', 'continue' Pry.commands.alias_command 's', 'step' Pry.commands.alias_command 'n', 'next' Pry.commands.alias_command 'f', 'finish' However, I dont know…
Benjamin Crouzier
  • 40,265
  • 44
  • 171
  • 236
14
votes
3 answers

How can I clear the rails console history

When I run rails c and press the up key when irb starts up, I can see the last commands I entered when my app dropped to irb after encountering a debugger command for the ruby-debug gem. I would not only like to clear these commands out, but I would…
Aaron
  • 13,349
  • 11
  • 66
  • 105
13
votes
2 answers

Use Pry in gems without modifying the Gemfile or using `require`

I am trying to debug a gem that's used by a Rails app. I cloned the Gem locally to go prying around (and also allows me to do nice things such as git bisect, etc.) # Gemfile gem "active_admin", path: "~/dev-forks/active_admin" However, I am often…
Jonathan Allard
  • 18,429
  • 11
  • 54
  • 75
13
votes
1 answer

How to use Pry within Factory Girl Rails?

In order to debug a factory I've inserted rescue binding.pry at the end of a problematic line: after_create do |my_object, proxy| my_object.foreign_key_id = proxy.generated_attribute rescue binding.pry Unfortunately, inside the resulting…
l0b0
  • 55,365
  • 30
  • 138
  • 223
12
votes
1 answer

Pry not stopping when called from a Ruby script that reads from stdin

I've created a console Ruby script that uses ARGF to load data from a file or stdin, that then calls Pry. This works great when I pass a file in (Pry pauses) but fails (Pry doesn't stop and just exits Ruby) when I pass my data using stdin. This is…
RyanWilcox
  • 13,890
  • 1
  • 36
  • 60
12
votes
2 answers

How to exit the loop in pry

If you keep type 'n', you will be in the loop for 100 times, How could I leave the each loop and continue to keep debugging from line 7 without exiting the loop then run the remain code automatically, The behavior of exit !!! are not suit for…
newBike
  • 14,385
  • 29
  • 109
  • 192
1
2
3
30 31