-
Notifications
You must be signed in to change notification settings - Fork 103
Description
Description
I typically use the pry-rails
gem so I can have pry as the default console for my Rails app. When I run rails console
with pry-rails
gem installed, I still see the Type 'jobs_help' to see how to connect to the available job servers to manage jobs
message when I enter the console, but when I try to run jobs_help
I get NameError: undefined local variable or method 'jobs_help' for main (NameError) from (pry):1:in '__pry__'
I'm guess this has to do with pry-rails replacing IRB with Pry. It would be nice to make the console helper methods jobs_help
, connect_to
, etc work when Pry is the main rails console.
This could just be a app configuration / 'order in which stuff gets loaded' problem on my part 🤷♂ .
Environmental Conditions
- MacOS 14.7.4
- ruby 3.4.2
- rails 8.0.2
Steps to Reproduce
- have
pry-rails
andmission_control-jobs
gem in your Gemfile and then runbundle
- open a rails console with
rails console
command - try to run the
jobs_help
command - receive
NameError: undefined local variable or method 'jobs_help' for main (NameError) from (pry):1:in '__pry__'
Expected Behavior
Be able to use the console helpers that come with mission_control-jobs
when using pry-rails
/ other than default IRB
Actual Behavior
- Unable to use the console job helpers
- Receive an error:
[1] pry(main)> jobs_help
NameError: undefined local variable or method 'jobs_help' for main (NameError)
from (pry):1:in '__pry__'
Workaround
Run rails console
with pry-rails
disabled using an inline ENV var: DISABLE_PRY_RAILS=1 rails console
Miscellaneous
- If I use the workaround to get a regular
rails console
using IRB, if I doPry.start
in the console, the same error resurfaces when runningjobs_help
so this may be affecting Pry in general too (and not just when PryRails is used) 🤷♂