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

Fail gracefully with invalid URI schemes #4953

Closed
schneems opened this issue Sep 7, 2016 · 3 comments
Closed

Fail gracefully with invalid URI schemes #4953

schneems opened this issue Sep 7, 2016 · 3 comments

Comments

@schneems
Copy link
Contributor

schneems commented Sep 7, 2016

$ bundle -v
Bundler version 1.13.0.rc.2
2.3.1  ~/documents/projects/cant_stop
$ cat Gemfile
source 'htps://rubygems.org'

gem 'artii'

2.3.1  ~/documents/projects/cant_stop
$ bundle install
--- ERROR REPORT TEMPLATE -------------------------------------------------------
- What did you do?

  I ran the command `/Users/richardschneeman/.gem/ruby/2.3.1/bin/bundle install`

- What did you expect to happen?

  I expected Bundler to...

- What happened instead?

  Instead, what happened was...


Error details

    NoMethodError: undefined method `request_uri' for #<URI::Generic htps://index.rubygems.org/versions>
      /Users/richardschneeman/.gem/ruby/2.3.1/gems/bundler-1.13.0.rc.2/lib/bundler/fetcher/downloader.rb:42:in `request'
      /Users/richardschneeman/.gem/ruby/2.3.1/gems/bundler-1.13.0.rc.2/lib/bundler/fetcher/downloader.rb:16:in `fetch'
      /Users/richardschneeman/.gem/ruby/2.3.1/gems/bundler-1.13.0.rc.2/lib/bundler/fetcher/compact_index.rb:111:in `block in compact_fetcher'
      /Users/richardschneeman/.gem/ruby/2.3.1/gems/bundler-1.13.0.rc.2/lib/bundler/vendor/compact_index_client/lib/compact_index_client/updater.rb:42:in `block in update'
      /Users/richardschneeman/.rubies/ruby-2.3.1/lib/ruby/2.3.0/tmpdir.rb:89:in `mktmpdir'
      /Users/richardschneeman/.gem/ruby/2.3.1/gems/bundler-1.13.0.rc.2/lib/bundler/vendor/compact_index_client/lib/compact_index_client/updater.rb:29:in `update'
      /Users/richardschneeman/.gem/ruby/2.3.1/gems/bundler-1.13.0.rc.2/lib/bundler/vendor/compact_index_client/lib/compact_index_client.rb:64:in `update'
      /Users/richardschneeman/.gem/ruby/2.3.1/gems/bundler-1.13.0.rc.2/lib/bundler/vendor/compact_index_client/lib/compact_index_client.rb:55:in `update_and_parse_checksums!'
      /Users/richardschneeman/.gem/ruby/2.3.1/gems/bundler-1.13.0.rc.2/lib/bundler/fetcher/compact_index.rb:67:in `available?'
      /Users/richardschneeman/.gem/ruby/2.3.1/gems/bundler-1.13.0.rc.2/lib/bundler/fetcher/compact_index.rb:15:in `call'
      /Users/richardschneeman/.gem/ruby/2.3.1/gems/bundler-1.13.0.rc.2/lib/bundler/fetcher/compact_index.rb:15:in `block in compact_index_request'
      /Users/richardschneeman/.gem/ruby/2.3.1/gems/bundler-1.13.0.rc.2/lib/bundler/fetcher.rb:157:in `use_api'
      /Users/richardschneeman/.gem/ruby/2.3.1/gems/bundler-1.13.0.rc.2/lib/bundler/source/rubygems.rb:332:in `block in api_fetchers'
      /Users/richardschneeman/.gem/ruby/2.3.1/gems/bundler-1.13.0.rc.2/lib/bundler/source/rubygems.rb:332:in `select'
      /Users/richardschneeman/.gem/ruby/2.3.1/gems/bundler-1.13.0.rc.2/lib/bundler/source/rubygems.rb:332:in `api_fetchers'
      /Users/richardschneeman/.gem/ruby/2.3.1/gems/bundler-1.13.0.rc.2/lib/bundler/source/rubygems.rb:337:in `block in remote_specs'
      /Users/richardschneeman/.gem/ruby/2.3.1/gems/bundler-1.13.0.rc.2/lib/bundler/index.rb:10:in `build'
      /Users/richardschneeman/.gem/ruby/2.3.1/gems/bundler-1.13.0.rc.2/lib/bundler/source/rubygems.rb:336:in `remote_specs'
      /Users/richardschneeman/.gem/ruby/2.3.1/gems/bundler-1.13.0.rc.2/lib/bundler/source/rubygems.rb:83:in `specs'
      /Users/richardschneeman/.gem/ruby/2.3.1/gems/bundler-1.13.0.rc.2/lib/bundler/lazy_specification.rb:58:in `__materialize__'
      /Users/richardschneeman/.gem/ruby/2.3.1/gems/bundler-1.13.0.rc.2/lib/bundler/spec_set.rb:91:in `block in materialize'
      /Users/richardschneeman/.gem/ruby/2.3.1/gems/bundler-1.13.0.rc.2/lib/bundler/spec_set.rb:88:in `map!'
      /Users/richardschneeman/.gem/ruby/2.3.1/gems/bundler-1.13.0.rc.2/lib/bundler/spec_set.rb:88:in `materialize'
      /Users/richardschneeman/.gem/ruby/2.3.1/gems/bundler-1.13.0.rc.2/lib/bundler/definition.rb:176:in `specs'
      /Users/richardschneeman/.gem/ruby/2.3.1/gems/bundler-1.13.0.rc.2/lib/bundler/definition.rb:164:in `resolve_remotely!'
      /Users/richardschneeman/.gem/ruby/2.3.1/gems/bundler-1.13.0.rc.2/lib/bundler/installer.rb:225:in `resolve_if_need'
      /Users/richardschneeman/.gem/ruby/2.3.1/gems/bundler-1.13.0.rc.2/lib/bundler/installer.rb:78:in `run'
      /Users/richardschneeman/.gem/ruby/2.3.1/gems/bundler-1.13.0.rc.2/lib/bundler/installer.rb:24:in `install'
      /Users/richardschneeman/.gem/ruby/2.3.1/gems/bundler-1.13.0.rc.2/lib/bundler/cli/install.rb:71:in `run'
      /Users/richardschneeman/.gem/ruby/2.3.1/gems/bundler-1.13.0.rc.2/lib/bundler/cli.rb:189:in `install'
      /Users/richardschneeman/.gem/ruby/2.3.1/gems/bundler-1.13.0.rc.2/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
      /Users/richardschneeman/.gem/ruby/2.3.1/gems/bundler-1.13.0.rc.2/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
      /Users/richardschneeman/.gem/ruby/2.3.1/gems/bundler-1.13.0.rc.2/lib/bundler/vendor/thor/lib/thor.rb:359:in `dispatch'
      /Users/richardschneeman/.gem/ruby/2.3.1/gems/bundler-1.13.0.rc.2/lib/bundler/cli.rb:20:in `dispatch'
      /Users/richardschneeman/.gem/ruby/2.3.1/gems/bundler-1.13.0.rc.2/lib/bundler/vendor/thor/lib/thor/base.rb:440:in `start'
      /Users/richardschneeman/.gem/ruby/2.3.1/gems/bundler-1.13.0.rc.2/lib/bundler/cli.rb:11:in `start'
      /Users/richardschneeman/.gem/ruby/2.3.1/gems/bundler-1.13.0.rc.2/exe/bundle:34:in `block in <top (required)>'
      /Users/richardschneeman/.gem/ruby/2.3.1/gems/bundler-1.13.0.rc.2/lib/bundler/friendly_errors.rb:100:in `with_friendly_errors'
      /Users/richardschneeman/.gem/ruby/2.3.1/gems/bundler-1.13.0.rc.2/exe/bundle:26:in `<top (required)>'
      /Users/richardschneeman/.gem/ruby/2.3.1/bin/bundle:23:in `load'
      /Users/richardschneeman/.gem/ruby/2.3.1/bin/bundle:23:in `<main>'

Environment

  Bundler   1.13.0.rc.2
  Rubygems  2.5.1
  Ruby      2.3.1p112 (2016-04-26 revision 54768) [x86_64-darwin14]
  GEM_HOME  /Users/richardschneeman/.gem/ruby/2.3.1
  GEM_PATH  /Users/richardschneeman/.gem/ruby/2.3.1:/Users/richardschneeman/.rubies/ruby-2.3.1/lib/ruby/gems/2.3.0
  Git       2.6.2

      Bundler settings

  jobs
    Set for the current user (/Users/richardschneeman/.bundle/config): "3"
  gem.coc
    Set for the current user (/Users/richardschneeman/.bundle/config): "true"
  gem.mit
    Set for the current user (/Users/richardschneeman/.bundle/config): "true"
  gem.test
    Set for the current user (/Users/richardschneeman/.bundle/config): "rspec"
--- 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=undefined+method+%60request_uri%27+for+%23%3CURI++Generic+htps+%2F%2Findex.rubygems.org%2Fversions%3E&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

It works if you gem install artii first.

@segiddins
Copy link
Member

segiddins commented Sep 7, 2016

We could do with a better error message for this, but it's because the scheme is htps

@schneems
Copy link
Contributor Author

schneems commented Sep 7, 2016

💥 thanks this was a copy-pasta from an old project

@segiddins segiddins changed the title Cannot install with gem artii Fail gracefully with invalid URI schemes Sep 7, 2016
homu added a commit that referenced this issue Sep 11, 2016
Fail gracefully when attempting to request from an unknown URI scheme

Closes #4953
@schneems
Copy link
Contributor Author

🎉

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

No branches or pull requests

2 participants