Questions tagged [pry-rails]

Pry-rails refers to the runtime developer console Pry that is used as an alternative to the standard IRB shell for the programming language Ruby. Use this tag for questions related to the runtime developer console.

Pry-rails refers to the runtime developer console Pry that is used as an alternative to the standard IRB shell for the programming language Ruby. Use this tag for questions related to the runtime developer console.

36 questions
49
votes
5 answers

Can't escape from eval with next using Pry-rails

Hi I've installed Pry to do some awesome debugging and had it working before but when I step into the code with 'next' I get the following error: SyntaxError: (eval):2: Can't escape from eval with next Code being used: def create binding.pry …
Shaun Frost Duke Jackson
  • 1,256
  • 1
  • 10
  • 22
7
votes
2 answers

Binding pry not being called in test environment

I'm currently writing specs for my Rails controller. I can't seem to get any puts statement or binding.pry, or binding.remote_pry working. I am able to get the remote pry working in the development environment. group :development, :test do gem…
Sherwyn Goh
  • 1,352
  • 1
  • 10
  • 19
7
votes
0 answers

binding.pry ignored by rspec

I am expecting a pry session to be opened in my console during execution of rspec. Am I doing something incorrect? Or expecting the wrong behavior? Gemfile: group :development, :test do gem 'rspec' gem 'rspec-rails' ... gem 'pry-rails' …
Eric Francis
  • 23,039
  • 31
  • 88
  • 122
6
votes
1 answer

How to correctly set up Pry in Rails 4.2

I'm confused about which gems need to be installed to correctly run Pry in a Rails 4.2 project. I seemed to be doing fine until recently. For some reason, binding.pry now seems to spit up whenever I try to step through a console session with next,…
Scro
  • 1,353
  • 2
  • 15
  • 26
5
votes
2 answers

Rails console error: Error loading ~/.pryrc: Command: `continue` not found

When I use the rails console on my current laptop (on any rails project), I get the following error when the console starts up. Rails console error: Error loading ~/.pryrc: Command: `continue` not found The console still loads and operates…
darkmoves
  • 328
  • 3
  • 12
4
votes
1 answer

Immediately evaluate multiple lines of code at same time in rails console when using pry?

Suppose we have pry installed, open the rails console, and run times = [1, 5, 10, 30, 72].sample(1)[0] nums = *(1..72) num_sample = nums.sample(times) Evaluation stops after line 2 (since the output of the second line runs off screen and hence the…
stevec
  • 41,291
  • 27
  • 223
  • 311
4
votes
2 answers

NoMethodError in pry-stack_explorer when using rails console

I am using pry for rails console. Whenever I evaluate some value in console, NoMethodError is raised in bindings_equal?, that is a method of pry-stack_explorer gem. The input and output is as follows. That is not harmful but a nuisance. I want to…
谷口昂平
  • 268
  • 3
  • 12
3
votes
3 answers

How to hide a column in pry / rails output

I have an image blob written to a field in the db, but I don't want to see that output in a console when I view the user object. I don't need the output changed or modified for the functioning of the application this is JUST for debugging /…
trh
  • 7,186
  • 2
  • 29
  • 41
3
votes
0 answers

I'm using Pry, specifically Remote-Pry, and when in console, I press back, an "Exit" prompts

So regardless of my console history, if I'm in a pry session, and if I press the up stroke, it should show what my last command was. Instead, it shows exit, and will execute exit if I press enter. Why does this occur? How can I fix it?
Trip
  • 26,756
  • 46
  • 158
  • 277
2
votes
1 answer

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 can access B and all its content correctly. However,…
platypus
  • 1,165
  • 5
  • 27
  • 47
2
votes
1 answer

How is the ls command in Pry able to accept -l as an argument?

I recently discovered that ls in pry can take an argument like so: ls -l. My initial question is what the -l part actually is - it is clearly not a string or symbol, and there is no local variable or method l defined, so is there something else…
johansenja
  • 568
  • 1
  • 7
  • 18
2
votes
1 answer

Switch from pry to IRB

I have discovered Pry not so long ago, but there are several aspects of Pry I don't like Cannot start writing before all libraries finish loading Execution time of copy-pasted code is quite slow Copy-pasting will just stop after some time; I have…
Cyril Duchon-Doris
  • 12,964
  • 9
  • 77
  • 164
2
votes
2 answers

How can I set my Pry prompt to be the current timestamp?

When I put the following line into ~/.pryrc it doesn't work as expected: Pry.config.prompt_name = Time.now.to_s Every prompt is equal to the time that Pry was launched. How do I update the prompt with the current timestamp, each time the prompt is…
New Alexandria
  • 6,951
  • 4
  • 57
  • 77
2
votes
0 answers

Using Hirb and Awesome Print with Pry Rails

I've been using Pry with Rails for a while via the Pry-Rails Gem. I want to add Hirb and Awesome Print to Pry, so I've added initialisation code to my ~/.pryrc file as described here and here: # ~/.pryrc require 'rubygems' # Hirb for…
Undistraction
  • 42,754
  • 56
  • 195
  • 331
1
vote
1 answer

"undefined method `pry'" error inside rails container although pry-rails gem is installed and required

I am running public ruby on rails web app docker image (gitlab) inside the container that I initialize with docker compose run --service-ports --detach [SERVICE_NAME] command. My goal is to debug the specific function inside image's source code…
netcat_dd
  • 27
  • 6
1
2 3