Skip to content

console helpers broken when using mission_control-jobs gem with pry-rails gem #256

@jrodden1

Description

@jrodden1

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

  1. have pry-rails and mission_control-jobs gem in your Gemfile and then run bundle
  2. open a rails console with rails console command
  3. try to run the jobs_help command
  4. 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 do Pry.start in the console, the same error resurfaces when running jobs_help so this may be affecting Pry in general too (and not just when PryRails is used) 🤷‍♂

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions