Skip to content

uninitialized constant PryStackExplorer::* when loading namespaced class #24

@delner

Description

@delner

I recently bumped a model of mine into a gem, which defines a class within a namespace as follows

module DE
  class Criteria
    ...
  end
end

I'm including this gem into my Rails 2 project, along with pry 0.10.1 and pry-stack_explorer 0.4.9.2. When I use my namespaced class in my car_critera.rb model as such:

class CarCriteria < DE::Criteria
  ...
end

On Rails application load, via console, I get the following load error, that seems to stem from pry-stack_explorer:

/Users/davidelner/.rvm/gems/ruby-1.9.3-p547@de-app/bundler/gems/rails-c51c00bb89b9/activesupport/lib/active_support/dependencies.rb:466:in `rescue in load_missing_constant': uninitialized constant PryStackExplorer::Criteria (NameError)

    from /Users/davidelner/.rvm/gems/ruby-1.9.3-p547@de-app/bundler/gems/rails-c51c00bb89b9/activesupport/lib/active_support/dependencies.rb:462:in `load_missing_constant'
    from /Users/davidelner/.rvm/gems/ruby-1.9.3-p547@de-app/bundler/gems/rails-c51c00bb89b9/activesupport/lib/active_support/dependencies.rb:106:in `const_missing_with_dependencies'
    from /Users/davidelner/src/de/app/models/car_criteria.rb:1:in `<top (required)>'

It doesn't seem to play well with namespaced models sourced from a gem? Do you have any ideas how to handle this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions