459 questions
-1
votes
0
answers
39
views
binding.pry debugger not working on Windows 11
I'm running into issues with binding.pry on Windows 11. When I insert it into my Ruby script, the program reaches that line but either skips over it or pauses without accepting any input.
🧪 Problem:
...
0
votes
0
answers
77
views
ruby `pry`: can I edit classes defined on the REPL?
Context: exploratory experimenting written directly in the REPL.
In pry, if I type edit fn_name I can open the definition of fn_name in an editor and change it. Say:
def fn_name
puts 'fn_name'
end
...
2
votes
1
answer
363
views
Unable to trap INT/TERM signals in nested Ruby processes
I'm trying to make a script that does 2 things: (1) starts a proxy and (2) runs a rails console with pry and a custom prompt
The problem is that I can't figure out how to prevent Ctrl+C interrupts ...
1
vote
1
answer
2k
views
Re-enable binding.pry after calling disable-pry
When I debug rails code, I sometimes set a binding.pry on a certain place that is triggered too often to be debugged, e.g. a loop.
Then I use the disable-pry command to step out of it and let the rest ...
14
votes
3
answers
4k
views
binding.pry doesn't work with command bin/dev
binding.pry doesn't work (console input not available) if I start the server with the bin/dev command. It only works with bin/rails s command.
I understand it has something to do with foreman and ...
0
votes
0
answers
1k
views
Rspec test to request controller action but seems action wasn't executed
I am new to Rails and Rspec and trying to write spec to test one non RESTful controller action.
Spec code:
require 'rails_helper'
RSpec.describe ReportsController, type: :controller do
describe &...
0
votes
1
answer
185
views
How to debug inside a code block without skipping it
I'm attempting to debug my code, in order to see if @new_participant is instantiated, but when I place binding.pry around it as displayed below, it hops over the block, and placing the debugger within ...
1
vote
1
answer
349
views
How can I paste multiple line command with Docker interactive mode but not evaluating?
For example I am opening an interactive command line window.
docker exec -it container rails c
When I paste a multiple-line command, it evaluate every line instead of pasting a block. How can I ...
1
vote
1
answer
649
views
Having problems using key arrows with pry in docker-compose
I'm having a problem using the key arrows with Pry and docker-compose. Every time i try to use the key arrows i'm obtaining ^[[A, for example. If i use irb in the terminal everything works without a ...
0
votes
1
answer
903
views
"ruby/3.0.1 isn't supported by this pry-doc version" error in Mac => Ruby => Pry
Screenshot of error
How do you solve the following error in Pry in the Mac terminal?
ruby/3.0.1 isn't supported by this pry-doc version
You get this error when you require pry-doc inside of Pry, in ...
0
votes
1
answer
785
views
Ruby and Pry (or other debugging gem): How can I show the definition of a variable?
I need to know how to check where the variable is - if not defined - then where it is assigned. Via Pry or similar gem (or Ruby standard library, that is - if possible)
3
votes
0
answers
362
views
binding.pry appears to be debouncing and then re-displaying text input
I'm following along with a tutorial book, and in order to step through my code I've required pry and added a binding.pry reference in a method which gets executed:
require 'pry'
module Rulers
...
1
vote
1
answer
711
views
How to show Rails ActiveRecord query time in Heroku pry rails console?
When I run an ActiveRecord query in my local console, I am shown both how long the query took to run (in ms) and the raw SQL that was generated from my ActiveRecord code. For example:
$ rails c
...
0
votes
0
answers
615
views
ByeBug or Pry not running on one of the controllers on Rails app
I have two controllers, One lets me use byebug and pry, the other just skips it, not sure why. Wondering if anyone has ran into a similar issue. I have installed pry and byebug correctly for it to ...
0
votes
0
answers
109
views
Can I add lines of code to execute when I start or reload! a Pry session?
My main rails app has a MultiTenent feature. I need to run something like this:
MultiTenant.current_tenant = Company.find(9)
When I start every Pry session or when I reload!. Can I configure Pry ...
1
vote
1
answer
233
views
Ruby Pry locate test file that triggered pry
I have a block of code that triggers my pry session via an integration test but no unit test exists. As such I'm not sure which test is exercising this code and need to run all tests each time I want ...
5
votes
0
answers
582
views
Puma and byebug/pry causes terminal corruption during concurrent requests
UPDATE: Looks like this has been a long-standing issue with Byebug: https://github.com/deivid-rodriguez/byebug/issues/487
When I run my Rails app using Puma with multiple workers in cluster mode and ...
1
vote
1
answer
452
views
How to increase the number of lines around binding.pry?
Using the gem pry-byebug, when I add a binding.pry somewhere, it shows only 5 lines around the line that I am:
157: max_bytes: limits_config.max_read_bytes_per_parser,
158: ...
2
votes
1
answer
91
views
Does pry cache local files for each terminal tab?
I'm working with a local library (gem), let's call it B, inside my rails application A (Rails version 6.0.2.2)
In A's Gemfile, I require B via:
gem 'B', path: '../B'
When I do rails c with pry, I ...
4
votes
3
answers
1k
views
Why is my pry-byebug package giving so much output when a command executes some error?
I had recently installed the gem pry-byebug, when I noticed it required at least Ruby version 2.4 in order to function. So I updated my Ruby using rvm, and then installed the gems pry and pry-byebug. ...
3
votes
2
answers
428
views
How to make a custom method available in Pry console
I've been writing this into my Pry console to find the stack trace scoped to my app:
caller.select {|line| line.include? "myapp" }
Is there a way to make this a method and just call something like ...
1
vote
0
answers
20
views
Pry looking for wrong version
I'm using RVM in a small repository and trying to spin up a Pry console. Pry 0.12.2 is installed as a gem in my @global gemset and not present in the repository's bundle. However, every time I run it ...
2
votes
1
answer
203
views
Adding blackboxed libraries to Pry debugging
Is it possible to "blackbox" libraries when using Pry?
I like to walk the stack when I hit a breakpoint, but I really don't care about active-record transactions management and such. In fact, it even ...
0
votes
3
answers
2k
views
pry command not found after installing gem
After installing the gem pry, and typing pry in terminal, i get an error saying that the command is not found:
Successfully installed pry-0.12.2
Parsing documentation for pry-0.12.2
Done installing ...
0
votes
0
answers
227
views
Debugging a gem in ruby-mine using the integrated debugger instead of pry
I can't debug the test cases (with the ruby-mine's debugger) of a project which is being used as an external library in one of my different projects. I can debug it using pry but not with the ...