Questions tagged [binding.pry]

19 questions
36
votes
3 answers

How to move to the next line in binding.pry ?

In byebug we can move to next line by typing 'n', similarly is there anyway to move to the next line in 'pry' ? I have gone through there documentation but nothing's works out.
vikas95prasad
  • 1,234
  • 1
  • 12
  • 37
9
votes
2 answers

getting error # when using binding.pry in rails 4

getting this weird error # in utf8_sanitizer when doing next using binding.pry in rails 4.2.1 with ruby 2.2.0 otherwise running without any error.
Rajesh Paul
  • 6,793
  • 6
  • 40
  • 57
4
votes
2 answers

Cannot load 'pry' - `require': cannot load such file -- pry (LoadError)

I'm trying to debug a simple ruby console script and am getting a load error when trying to require pry: I'm using rbenv to management environment. I'm using Ruby version: 2.3.1. Trying to use Pry '~> 0.10.4'…
gangelo
  • 3,034
  • 4
  • 29
  • 43
3
votes
1 answer

Ruby (bundler) How to automatically require Pry

Given a Gemfile containing: source 'https://rubygems.org' gem 'pry' And a ruby file containing: require 'bundler/setup' # NOT using this line: # require 'pry' binding.pry I am getting this error: enter code hereundefined method pry' for…
Jesper Rønn-Jensen
  • 106,591
  • 44
  • 118
  • 155
2
votes
1 answer

Unexplained pry behavior in Ruby

The bug on line 11 is put there on purpose. I am curious about how pry works in this example. In the code below, when I enter pry, if I type name I get nil, which means that pry is outputting the value of the local variable which will be initialized…
SrdjaNo1
  • 755
  • 3
  • 8
  • 18
2
votes
1 answer

What's byebug's version of pry's whereami?

In Ruby, we have a gem called byebug and a gem called pry. In pry, you can type whereami to see where you are, when you are in a binding.pry session. How do you do the same thing in byebug?
Henry Yang
  • 2,283
  • 3
  • 21
  • 38
2
votes
2 answers

__FILE__ returns different value when using binding.pry

__FILE__ returns the path of the current Ruby script file. One potentially significant problem is that, if using binding.pry, __FILE__ evaluates to (pry). It is potentially problematic to have __FILE__ evaluate to different values depending on…
1
vote
1 answer

How to use helpers in pry-byebug?

In the rails console, we can prepend helper. to helpers to use them, like so: helper.time_ago_in_words(Time.now - 60*60*2) but this doesn't work in the server console during a pry-byebug debugging How can I use a method like time_ago_in_words after…
stevec
  • 41,291
  • 27
  • 223
  • 311
1
vote
0 answers

Rails pry-byebug not accessed

I am trying to debug my code using the pry-byebug tool, but when I launch "rails console" in my terminal and then call on the class method in which the debugger should come into action, nothing happens. I have installed the gem and did a bundle…
Seb
  • 363
  • 1
  • 18
1
vote
0 answers

Binding.pry not showing on terminal

I've just created a Rails project using Rails '~> 5.0.0', '>= 5.0.0.1' and whenever I try to debug it with binding.pry it freezes the whole application and also the terminal where I started the rails s command. the gems I'm using are gem 'pry' gem…
Fred Novack
  • 727
  • 9
  • 27
1
vote
1 answer

Using Rails4.1.1 and Ruby 2.0.0, binding.pry's terminal output is sometimes empty

I'm trying to debug a Rails 4.1.1 app using binding.pry but more often than not when the execution breaks and I try to show the values of my variables it just returns an empty string, or nothing (hard to distinguish). But other times it spits out…
Dave Sag
  • 13,266
  • 14
  • 86
  • 134
0
votes
2 answers

Binding.pry not showing the stopping point in console after ruby 3 upgrade

I am new to ruby, we have a ROR microservice(rails version 6.1) , recently i updated the ruby version on the service from 2.7 to 3.0 , after this since there were failures and i wanted to debug it, so i added binding.pry , when the binding.pry is…
0
votes
1 answer

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 of the program continue. But now when I make…
23tux
  • 14,104
  • 15
  • 88
  • 187
0
votes
1 answer

How to take payload of an API as an argument in ruby function

I have done rails c on my console of rubymine. I want to execute a function in rails console. the function is funtion_one(Api_payload , some_integer_Value) API_payload is : - { "data" : [ { "from" : "today", "to" : "next_day" …
0
votes
1 answer

Unable to reach binding.pry

Trying to use binding.pry works until the emoticons_hash.each Trying to use it inside of .each or after it will not trigger it. It also doesn't work within other methods of this program, even with a puts "hello" after it. require 'pry' require…
ILikeClouds
  • 35
  • 1
  • 1
  • 4
1
2