Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

NameError during Runtime#require raises unexpected error #3960

Closed
indirect opened this issue Aug 22, 2015 · 5 comments
Closed

NameError during Runtime#require raises unexpected error #3960

indirect opened this issue Aug 22, 2015 · 5 comments

Comments

@indirect
Copy link
Member

$ bundle -v
Bundler version 1.10.6

$ bundle console
--- ERROR REPORT TEMPLATE -------------------------------------------------------
- What did you do?

  I ran the command `/Users/andre/.gem/ruby/2.2.2/bin/bundle console`

- What did you expect to happen?

  I expected Bundler to...

- What happened instead?

  Instead, what actually happened was...


Error details

    NameError: uninitialized constant Postgres
      /Users/andre/.gem/ruby/2.2.2/gems/bundler-1.10.6/lib/bundler/runtime.rb:76:in `const_get'
      /Users/andre/.gem/ruby/2.2.2/gems/bundler-1.10.6/lib/bundler/runtime.rb:76:in `require'
      /Users/andre/.gem/ruby/2.2.2/gems/bundler-1.10.6/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
      /Users/andre/.gem/ruby/2.2.2/gems/bundler-1.10.6/lib/bundler/runtime.rb:72:in `each'
      /Users/andre/.gem/ruby/2.2.2/gems/bundler-1.10.6/lib/bundler/runtime.rb:72:in `block in require'
      /Users/andre/.gem/ruby/2.2.2/gems/bundler-1.10.6/lib/bundler/runtime.rb:61:in `each'
      /Users/andre/.gem/ruby/2.2.2/gems/bundler-1.10.6/lib/bundler/runtime.rb:61:in `require'
      /Users/andre/.gem/ruby/2.2.2/gems/bundler-1.10.6/lib/bundler.rb:134:in `require'
      /Users/andre/.gem/ruby/2.2.2/gems/bundler-1.10.6/lib/bundler/cli/console.rb:10:in `run'
      /Users/andre/.gem/ruby/2.2.2/gems/bundler-1.10.6/lib/bundler/cli.rb:308:in `console'
      /Users/andre/.gem/ruby/2.2.2/gems/bundler-1.10.6/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
      /Users/andre/.gem/ruby/2.2.2/gems/bundler-1.10.6/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
      /Users/andre/.gem/ruby/2.2.2/gems/bundler-1.10.6/lib/bundler/vendor/thor/lib/thor.rb:359:in `dispatch'
      /Users/andre/.gem/ruby/2.2.2/gems/bundler-1.10.6/lib/bundler/vendor/thor/lib/thor/base.rb:440:in `start'
      /Users/andre/.gem/ruby/2.2.2/gems/bundler-1.10.6/lib/bundler/cli.rb:10:in `start'
      /Users/andre/.gem/ruby/2.2.2/gems/bundler-1.10.6/bin/bundle:20:in `block in <top (required)>'
      /Users/andre/.gem/ruby/2.2.2/gems/bundler-1.10.6/lib/bundler/friendly_errors.rb:7:in `with_friendly_errors'
      /Users/andre/.gem/ruby/2.2.2/gems/bundler-1.10.6/bin/bundle:18:in `<top (required)>'
      /Users/andre/.gem/ruby/2.2.2/bin/bundle:23:in `load'
      /Users/andre/.gem/ruby/2.2.2/bin/bundle:23:in `<main>'

Environment

    Bundler   1.10.6
    Rubygems  2.4.5
    Ruby      2.2.2p95 (2015-04-13 revision 50295) [x86_64-darwin14]
    GEM_HOME  /Users/andre/src/bundler/bundler-api/.bundle/ruby/2.2.0
    GEM_PATH
    Git       2.3.0

Bundler settings

    path
      Set for your local app (/Users/andre/src/bundler/bundler-api/.bundle/config): ".bundle"
    disable_shared_gems
      Set for your local app (/Users/andre/src/bundler/bundler-api/.bundle/config): "1"
    jobs
      Set via BUNDLE_JOBS: "8"
    bin_path
      Set via BUNDLE_BIN_PATH: "/Users/andre/.gem/ruby/2.2.2/gems/bundler-1.10.6/bin/bundle"
    gemfile
      Set via BUNDLE_GEMFILE: "/Users/andre/src/bundler/bundler-api/Gemfile"
    orig_manpath
      Set via BUNDLE_ORIG_MANPATH: "/usr/local/share/man:/usr/share/man:/usr/local/share/man:/opt/X11/share/man:/usr/local/MacGPG2/share/man"
--- TEMPLATE END ----------------------------------------------------------------

Unfortunately, an unexpected error occurred, and Bundler cannot continue.

First, try this link to see if there are any existing issue reports for this error:
https://github.com/bundler/bundler/search?q=uninitialized+constant+Postgres&type=Issues

If there aren't any reports for this error yet, please create copy and paste the report template above into a new issue. Don't forget to anonymize any private data! The new issue form is located at:
https://github.com/bundler/bundler/issues/new
@indirect
Copy link
Member Author

We should handle LoadErrors during Bundler.require with a warning at the most, and probably no printed message?

@segiddins
Copy link
Member

@indirect gemfile?

@indirect
Copy link
Member Author

Bundler-Api repo, new index branch

@segiddins
Copy link
Member

All we do there is call require -- the const_get isn't ours

@indirect
Copy link
Member Author

We shouldn't be showing the unexpected error template regardless, though

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants