carlhuda/bundler — Issue #1672: Bundler 1.1.rc.7 crashes on buggy gem name
Author: korny
Created: 2012-02-23 11:45:12+00:00
State: open

Stupid me forgot a comma in my Gemfile:

```ruby
gem "roadie" "~> 1.1.3" # emails
```

This is obviously wrong, but it crashes the latest Bundler RC when I run "bundle":

```
Fetching gem metadata from http://rubygems.org/.Unfortunately, a fatal error has occurred. Please report this error to the Bundler issue tracker at https://github.com/carlhuda/bundler/issues so that we can fix it. Thanks!
/Users/murphy/.rvm/rubies/ree-1.8.7-2011.03/lib/ruby/1.8/uri/common.rb:436:in `split': bad URI(is not URI?): http://rubygems.org/api/v1/dependencies?gems=rails,rake,rdoc,json,mysql2,nokogiri,oily_png,raspell,RedCloth,prawn,prawn-core,prawn-layout,prawn-format,haml,sass,compass,thinking-sphinx,ts-delayed-delta,thinking-sphinx-raspell,validates_date_time,validates_existence,active_link_to,acts-as-taggable-on,aws-s3,BlueCloth,cancan,comma,deadlock_retry,delayed_job,directed-edge,fastercsv,google-spreadsheet-ruby,googlecharts,jquery-rails,jrails,panda,paperclip,rakismet,roadie~> 1.1.3,rubyzip,settingslogic,simple-rss,sitemap_generator,symbolize,system_timer,whenever,will_paginate,workflow,passenger,newrelic_rpm,airbrake,inaction_mailer,rails-dev-boost,capistrano,amazon-ec2,codebase4,rspec-rails,email_spec,factory_girl,cucumber,cucumber-rails,database_cleaner,capybara,akephalos,launchy,selenium-webdriver (URI::InvalidURIError)
from /Users/murphy/.rvm/rubies/ree-1.8.7-2011.03/lib/ruby/1.8/uri/common.rb:485:in `parse'
from /Users/murphy/.rvm/gems/ree-1.8.7-2011.03@sofatutor/gems/bundler-1.1.rc.7/lib/bundler/fetcher.rb:159:in `fetch_dependency_remote_specs'
from /Users/murphy/.rvm/gems/ree-1.8.7-2011.03@sofatutor/gems/bundler-1.1.rc.7/lib/bundler/fetcher.rb:122:in `fetch_remote_specs'
from /Users/murphy/.rvm/gems/ree-1.8.7-2011.03@sofatutor/gems/bundler-1.1.rc.7/lib/bundler/fetcher.rb:70:in `specs'
from /Users/murphy/.rvm/gems/ree-1.8.7-2011.03@sofatutor/gems/bundler-1.1.rc.7/lib/bundler/source.rb:230:in `remote_specs'
from /Users/murphy/.rvm/gems/ree-1.8.7-2011.03@sofatutor/gems/bundler-1.1.rc.7/lib/bundler/source.rb:228:in `each'
from /Users/murphy/.rvm/gems/ree-1.8.7-2011.03@sofatutor/gems/bundler-1.1.rc.7/lib/bundler/source.rb:228:in `remote_specs'
from /Users/murphy/.rvm/gems/ree-1.8.7-2011.03@sofatutor/gems/bundler-1.1.rc.7/lib/bundler/source.rb:161:in `fetch_specs'
from /Users/murphy/.rvm/gems/ree-1.8.7-2011.03@sofatutor/gems/bundler-1.1.rc.7/lib/bundler/source.rb:70:in `specs'
from /Users/murphy/.rvm/gems/ree-1.8.7-2011.03@sofatutor/gems/bundler-1.1.rc.7/lib/bundler/definition.rb:175:in `index'
from /Users/murphy/.rvm/gems/ree-1.8.7-2011.03@sofatutor/gems/bundler-1.1.rc.7/lib/bundler/definition.rb:173:in `each'
from /Users/murphy/.rvm/gems/ree-1.8.7-2011.03@sofatutor/gems/bundler-1.1.rc.7/lib/bundler/definition.rb:173:in `index'
from /Users/murphy/.rvm/gems/ree-1.8.7-2011.03@sofatutor/gems/bundler-1.1.rc.7/lib/bundler/index.rb:7:in `build'
from /Users/murphy/.rvm/gems/ree-1.8.7-2011.03@sofatutor/gems/bundler-1.1.rc.7/lib/bundler/definition.rb:161:in `index'
from /Users/murphy/.rvm/gems/ree-1.8.7-2011.03@sofatutor/gems/bundler-1.1.rc.7/lib/bundler/definition.rb:155:in `resolve'
from /Users/murphy/.rvm/gems/ree-1.8.7-2011.03@sofatutor/gems/bundler-1.1.rc.7/lib/bundler/definition.rb:90:in `specs'
from /Users/murphy/.rvm/gems/ree-1.8.7-2011.03@sofatutor/gems/bundler-1.1.rc.7/lib/bundler/definition.rb:85:in `resolve_remotely!'
from /Users/murphy/.rvm/gems/ree-1.8.7-2011.03@sofatutor/gems/bundler-1.1.rc.7/lib/bundler/installer.rb:48:in `run'
from /Users/murphy/.rvm/gems/ree-1.8.7-2011.03@sofatutor/gems/bundler-1.1.rc.7/lib/bundler/installer.rb:12:in `install'
from /Users/murphy/.rvm/gems/ree-1.8.7-2011.03@sofatutor/gems/bundler-1.1.rc.7/lib/bundler/cli.rb:220:in `install'
from /Users/murphy/.rvm/gems/ree-1.8.7-2011.03@sofatutor/gems/bundler-1.1.rc.7/lib/bundler/vendor/thor/task.rb:22:in `send'
from /Users/murphy/.rvm/gems/ree-1.8.7-2011.03@sofatutor/gems/bundler-1.1.rc.7/lib/bundler/vendor/thor/task.rb:22:in `run'
from /Users/murphy/.rvm/gems/ree-1.8.7-2011.03@sofatutor/gems/bundler-1.1.rc.7/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task'
from /Users/murphy/.rvm/gems/ree-1.8.7-2011.03@sofatutor/gems/bundler-1.1.rc.7/lib/bundler/vendor/thor.rb:263:in `dispatch'
from /Users/murphy/.rvm/gems/ree-1.8.7-2011.03@sofatutor/gems/bundler-1.1.rc.7/lib/bundler/vendor/thor/base.rb:386:in `start'
from /Users/murphy/.rvm/gems/ree-1.8.7-2011.03@sofatutor/gems/bundler-1.1.rc.7/bin/bundle:13
from /Users/murphy/.rvm/gems/ree-1.8.7-2011.03@sofatutor/bin/bundle:19:in `load'
from /Users/murphy/.rvm/gems/ree-1.8.7-2011.03@sofatutor/bin/bundle:19
```

The current release version (1.0.22) handles this gracefully:

```
Could not find gem 'roadie~> 1.1.3 (>= 0) ruby' in any of the gem sources listed in your Gemfile.
```

The URL is valid, but seemingly URI.parse doesn't like it.