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
1
vote
1 answer

How to disable Pry autocomplete?

I would like to disable autocomplete in Pry. How to do it? I'm using it in Rails console(from Emacs/inf-ruby) and it is very slow and annoying in my legacy app. Related question: Disable irb autocomplete
BinaryButterfly
  • 18,137
  • 13
  • 50
  • 91
1
vote
1 answer

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 Running via Spring preloader in process 92420 Loading…
michaelrbock
  • 1,160
  • 1
  • 11
  • 20
1
vote
3 answers

How to copy multiple lines of code into byebug?

byebug doesn't seem to be able to handle multiple lines of code. Example I put byebug into the controller, and the next lines of code are (these could be anything, just an example here): payment_intent = Stripe::PaymentIntent.create({ …
stevec
  • 41,291
  • 27
  • 223
  • 311
1
vote
0 answers

Pry-rails appears to be corrupting my terminal, how can I fix this issues?

Hopefully someone can help me with this issue. I have noticed for a while, whilst using standard pry with Ruby, that occasionally pry will appear to become stuck in a loop, requiring me to kill the terminal and reopen it. This was moderately…
1
vote
1 answer

How to install pry/pry-rails globally for all projects?

How can replace irb and rails console with pry/pry-console globally for every project without having to include it in a project?
Bhushan Lodha
  • 6,824
  • 7
  • 62
  • 100
1
vote
1 answer

Pry Rails on docker not working

I tried the approach with tty: true stdin_open: true inside docker-compose.yml and attaching to the container id (following http://www.chris-kelly.net/2016/07/25/debugging-rails-with-pry-within-a-docker-container/) but it just hangs. I also tried…
Bogdan Popa
  • 1,099
  • 1
  • 16
  • 37
1
vote
1 answer

There was an error while trying to load the gem 'pry-rails'

I am not familiar with Ruby, but I am anyway trying to install and test iQvoc ( https://github.com/innoq/iqvoc ). After some initial problems I managed to install it with heroku. I am trying now to export a small test thesaurus but I have some…
K3it4r0
  • 195
  • 12
1
vote
0 answers

Using pry-rescue with rspec shows strange code point

We are trying to use pry-rescue inside of rspec to get a debugger when a spec fails. Now when this expectation fails: expect(page).to have_content('Thanks for signing up!') pry does open, but the code point that pry is at looks like this: From:…
Alexander Presber
  • 6,429
  • 2
  • 37
  • 66
1
vote
1 answer

binding.pry in Rails View: NameError: undefined local variable or method

I use Rails 4 with the gems byebug, pry-rails, pry-byebug, pry-stack_explorer. When i replace in a view file: <%= order.display_item_total %> with <%= binding.pry %> and type inside the…
StandardNerd
  • 4,093
  • 9
  • 46
  • 77
1
vote
1 answer

Why `binding.pry` halts at the wrong place?

For some reason when I set a breakpoint using binding.pry, the program ends up halting at a totally different (and alien looking!) place. Am I doing it wrong? Gemfile (shortended) gem "rails", "~> 4.1" gem "pry" gem "pry-rails" gem "pry-doc" gem…
Yan Foto
  • 10,850
  • 6
  • 57
  • 88
1
vote
0 answers

debug an rails gem but pry didn't stop at the breakpoing

I want to trace what does event_calendar do , So I added the gem then bundle install and I found its install location is at ~/.rvm/gems/ruby-1.9.3-p448/gems/event-calendar-2.3.3/generators/event_calendar So I add require 'pry' and embedded the…
newBike
  • 14,385
  • 29
  • 109
  • 192
0
votes
0 answers

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 to do this automatically?
Dan Tappin
  • 2,692
  • 3
  • 37
  • 77
0
votes
1 answer

rails not updating session hash on ajax request without pry

I'm trying to develop a cart system(for a practice e-commerce project) on rails 6. The code(explaination): I have a link with class attribute "add_to_cart_link" then I use a jquery to select the elements with the mentioned class and set a on…
0
votes
1 answer

Rails RSpec Pry "reload!"

ruby 2.3.1 rails (3.2.22.4) rspec-rails (2.14.2) pry-rails (0.3.2) pry-byebug (3.6.0) pry (0.10.4) I am using a bit old version of Ruby and Rails. I am running RSpec tests in the Ubuntu Terminal: rspec ./spec/features/some_spec.rb and I am using…
prograils
  • 2,248
  • 1
  • 28
  • 45
0
votes
0 answers

rails-pry failure to create breakpoint: before_session hook failed: NoMethodError: undefined method `chomp' for nil:NilClass

I'm using rails-pry to create a breakpoint with a binding.pry statement. This has worked just fine for just about ever. However now there's this fun new error message I'm not even sure how to being debugging the debugger: before_session hook failed:…
Dylan Pierce
  • 4,313
  • 3
  • 35
  • 45