{"action":"created","issue":{"url":"https://api.github.com/repos/bundler/bundler/issues/3671","repository_url":"https://api.github.com/repos/bundler/bundler","labels_url":"https://api.github.com/repos/bundler/bundler/issues/3671/labels{/name}","comments_url":"https://api.github.com/repos/bundler/bundler/issues/3671/comments","events_url":"https://api.github.com/repos/bundler/bundler/issues/3671/events","html_url":"https://github.com/bundler/bundler/issues/3671","id":79116926,"number":3671,"title":"Bundler issues warning when a gem is on both the global source and a one-off source","user":{"login":"cowboyd","id":4205,"avatar_url":"https://avatars.githubusercontent.com/u/4205?v=3","gravatar_id":"","url":"https://api.github.com/users/cowboyd","html_url":"https://github.com/cowboyd","followers_url":"https://api.github.com/users/cowboyd/followers","following_url":"https://api.github.com/users/cowboyd/following{/other_user}","gists_url":"https://api.github.com/users/cowboyd/gists{/gist_id}","starred_url":"https://api.github.com/users/cowboyd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cowboyd/subscriptions","organizations_url":"https://api.github.com/users/cowboyd/orgs","repos_url":"https://api.github.com/users/cowboyd/repos","events_url":"https://api.github.com/users/cowboyd/events{/privacy}","received_events_url":"https://api.github.com/users/cowboyd/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/bundler/bundler/labels/status:%20working%20/%20ready","name":"status: working / ready","color":"fef2c0"},{"url":"https://api.github.com/repos/bundler/bundler/labels/type:%20bug%20report","name":"type: bug report","color":"bfe5bf"}],"state":"open","locked":false,"assignee":{"login":"segiddins","id":1946610,"avatar_url":"https://avatars.githubusercontent.com/u/1946610?v=3","gravatar_id":"","url":"https://api.github.com/users/segiddins","html_url":"https://github.com/segiddins","followers_url":"https://api.github.com/users/segiddins/followers","following_url":"https://api.github.com/users/segiddins/following{/other_user}","gists_url":"https://api.github.com/users/segiddins/gists{/gist_id}","starred_url":"https://api.github.com/users/segiddins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/segiddins/subscriptions","organizations_url":"https://api.github.com/users/segiddins/orgs","repos_url":"https://api.github.com/users/segiddins/repos","events_url":"https://api.github.com/users/segiddins/events{/privacy}","received_events_url":"https://api.github.com/users/segiddins/received_events","type":"User","site_admin":false},"assignees":[{"login":"segiddins","id":1946610,"avatar_url":"https://avatars.githubusercontent.com/u/1946610?v=3","gravatar_id":"","url":"https://api.github.com/users/segiddins","html_url":"https://github.com/segiddins","followers_url":"https://api.github.com/users/segiddins/followers","following_url":"https://api.github.com/users/segiddins/following{/other_user}","gists_url":"https://api.github.com/users/segiddins/gists{/gist_id}","starred_url":"https://api.github.com/users/segiddins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/segiddins/subscriptions","organizations_url":"https://api.github.com/users/segiddins/orgs","repos_url":"https://api.github.com/users/segiddins/repos","events_url":"https://api.github.com/users/segiddins/events{/privacy}","received_events_url":"https://api.github.com/users/segiddins/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/bundler/bundler/milestones/13","html_url":"https://github.com/bundler/bundler/milestones/2.0%20%E2%80%94%20Breaking%20Changes","labels_url":"https://api.github.com/repos/bundler/bundler/milestones/13/labels","id":5968,"number":13,"title":"2.0 — Breaking Changes","description":"","creator":{"login":"hone","id":16457,"avatar_url":"https://avatars.githubusercontent.com/u/16457?v=3","gravatar_id":"","url":"https://api.github.com/users/hone","html_url":"https://github.com/hone","followers_url":"https://api.github.com/users/hone/followers","following_url":"https://api.github.com/users/hone/following{/other_user}","gists_url":"https://api.github.com/users/hone/gists{/gist_id}","starred_url":"https://api.github.com/users/hone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hone/subscriptions","organizations_url":"https://api.github.com/users/hone/orgs","repos_url":"https://api.github.com/users/hone/repos","events_url":"https://api.github.com/users/hone/events{/privacy}","received_events_url":"https://api.github.com/users/hone/received_events","type":"User","site_admin":false},"open_issues":15,"closed_issues":11,"state":"open","created_at":"2011-04-27T23:09:27Z","updated_at":"2016-08-09T00:12:45Z","due_on":null,"closed_at":null},"comments":13,"created_at":"2015-05-21T18:46:26Z","updated_at":"2016-09-07T13:14:56Z","closed_at":null,"body":"I have a Gemfile that looks like this:\r\n\r\n```ruby\r\nsource \"https://rubygems.org\"\r\ngem \"rails\"\r\ngem 'capistrano-graphite', '1.0.5.spiceworks.1', require: false, source: \"http://gem-server.spice.spiceworks.com\"\r\n```\r\n\r\nThe custom source `gem-server.spice.spiceworks.com` contains both the `capistrano-graphite` gem as well as `rails`.\r\n\r\nWhen I run bundle install, it succeeds, but indicates several warnings about some of the gems being on both sources:\r\n\r\n```sh\r\n/C/S/tmp ❯❯❯ bundle install\r\nFetching gem metadata from http://gem-server.spice.spiceworks.com/...\r\nFetching gem metadata from https://rubygems.org/......\r\nFetching version metadata from http://gem-server.spice.spiceworks.com/...\r\nFetching version metadata from https://rubygems.org/..\r\nFetching gem metadata from http://gem-server.spice.spiceworks.com/...\r\nFetching version metadata from http://gem-server.spice.spiceworks.com/...\r\nFetching dependency metadata from http://gem-server.spice.spiceworks.com/..\r\nUsing i18n 0.7.0\r\nUsing builder 3.2.2\r\nUsing erubis 2.7.0\r\nUsing mini_portile 0.6.2\r\nUsing rack 1.6.1\r\nUsing mime-types 2.5\r\nUsing arel 6.0.0\r\nUsing colorize 0.7.7\r\nUsing net-ssh 2.9.2\r\nUsing bundler 1.9.9\r\nUsing thor 0.19.1\r\nUsing json 1.8.2\r\nUsing rake 10.4.2\r\nUsing thread_safe 0.3.5\r\nUsing minitest 5.6.1\r\nUsing nokogiri 1.6.6.2\r\nUsing rack-test 0.6.3\r\nUsing sprockets 3.1.0\r\nUsing mail 2.6.3\r\nUsing net-scp 1.2.1\r\nUsing tzinfo 1.2.2\r\nUsing loofah 2.0.2\r\nUsing sshkit 1.7.1\r\nUsing rails-html-sanitizer 1.0.2\r\nUsing capistrano 3.4.0\r\nInstalling capistrano-graphite 1.0.5.spiceworks.1\r\nInstalling activesupport 4.2.1\r\nUsing rails-deprecated_sanitizer 1.0.3\r\nUsing globalid 0.3.5\r\nUsing activemodel 4.2.1\r\nUsing rails-dom-testing 1.0.6\r\nUsing activejob 4.2.1\r\nUsing actionview 4.2.1\r\nInstalling actionpack 4.2.1\r\nUsing actionmailer 4.2.1\r\nUsing railties 4.2.1\r\nUsing sprockets-rails 2.3.1\r\nInstalling activerecord 4.2.1\r\nInstalling rails 4.2.1\r\nBundle complete! 2 Gemfile dependencies, 39 gems now installed.\r\nUse `bundle show [gemname]` to see where a bundled gem is installed.\r\nWarning: the gem 'activesupport' was found in multiple sources.\r\nInstalled from: https://rubygems.org/\r\nAlso found in:\r\n  * http://gem-server.spice.spiceworks.com/\r\nYou should add a source requirement to restrict this gem to your preferred source.\r\nFor example:\r\n    gem 'activesupport', :source => 'https://rubygems.org/'\r\nThen uninstall the gem 'activesupport' (or delete all bundled gems) and then install again.\r\nWarning: the gem 'activerecord' was found in multiple sources.\r\nInstalled from: https://rubygems.org/\r\nAlso found in:\r\n  * http://gem-server.spice.spiceworks.com/\r\nYou should add a source requirement to restrict this gem to your preferred source.\r\nFor example:\r\n    gem 'activerecord', :source => 'https://rubygems.org/'\r\nThen uninstall the gem 'activerecord' (or delete all bundled gems) and then install again.\r\nWarning: the gem 'actionpack' was found in multiple sources.\r\nInstalled from: https://rubygems.org/\r\nAlso found in:\r\n  * http://gem-server.spice.spiceworks.com/\r\nYou should add a source requirement to restrict this gem to your preferred source.\r\nFor example:\r\n    gem 'actionpack', :source => 'https://rubygems.org/'\r\nThen uninstall the gem 'actionpack' (or delete all bundled gems) and then install again.\r\nWarning: the gem 'rails' was found in multiple sources.\r\nInstalled from: https://rubygems.org/\r\nAlso found in:\r\n  * http://gem-server.spice.spiceworks.com/\r\nYou should add a source requirement to restrict this gem to your preferred source.\r\nFor example:\r\n    gem 'rails', :source => 'https://rubygems.org/'\r\nThen uninstall the gem 'rails' (or delete all bundled gems) and then install again.\r\n```\r\n\r\nI don't know if that is the intended behavior, or a bug in bundler, but my intuition tells me that the Gemfile is pretty unambigous: the custom source should only be used for the one gem. I don't really care that other gems might incidentally exist on my custom source because I've specified rubygems.org as the global one and so it should take precedence over all others.\r\n\r\nThe same error manifests itself if I structure the `Gemfile` like so:\r\n\r\n```ruby\r\nsource \"https://rubygems.org\"\r\ngem \"rails\"\r\n\r\nsource \"http://gem-server.spice.spiceworks.com\" do\r\n  gem 'capistrano-graphite', '1.0.5.spiceworks.1', require: false\r\nend\r\n```\r\n\r\nThis seems also very counterintuitive since the block form communicates very strongly to the reader that the source is only in effect inside the scope of the block, and cannot effect decisions outside it.\r\n\r\nMight be related to #3537 "},"comment":{"url":"https://api.github.com/repos/bundler/bundler/issues/comments/245276355","html_url":"https://github.com/bundler/bundler/issues/3671#issuecomment-245276355","issue_url":"https://api.github.com/repos/bundler/bundler/issues/3671","id":245276355,"user":{"login":"segiddins","id":1946610,"avatar_url":"https://avatars.githubusercontent.com/u/1946610?v=3","gravatar_id":"","url":"https://api.github.com/users/segiddins","html_url":"https://github.com/segiddins","followers_url":"https://api.github.com/users/segiddins/followers","following_url":"https://api.github.com/users/segiddins/following{/other_user}","gists_url":"https://api.github.com/users/segiddins/gists{/gist_id}","starred_url":"https://api.github.com/users/segiddins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/segiddins/subscriptions","organizations_url":"https://api.github.com/users/segiddins/orgs","repos_url":"https://api.github.com/users/segiddins/repos","events_url":"https://api.github.com/users/segiddins/events{/privacy}","received_events_url":"https://api.github.com/users/segiddins/received_events","type":"User","site_admin":false},"created_at":"2016-09-07T13:14:56Z","updated_at":"2016-09-07T13:14:56Z","body":"Given https://github.com/bundler/bundler/pull/3696 has been fixed on 2-0-dev, can we close this?"}}
{"actor":{"display_login":"segiddins"}}