{"action":"created","issue":{"url":"https://api.github.com/repos/bundler/bundler/issues/3762","labels_url":"https://api.github.com/repos/bundler/bundler/issues/3762/labels{/name}","comments_url":"https://api.github.com/repos/bundler/bundler/issues/3762/comments","events_url":"https://api.github.com/repos/bundler/bundler/issues/3762/events","html_url":"https://github.com/bundler/bundler/issues/3762","id":89410179,"number":3762,"title":"Bundler 1.10.1 breaks Rails 2.3.x plugin-loading","user":{"login":"tony-spataro-rs","id":4257476,"avatar_url":"https://avatars.githubusercontent.com/u/4257476?v=3","gravatar_id":"","url":"https://api.github.com/users/tony-spataro-rs","html_url":"https://github.com/tony-spataro-rs","followers_url":"https://api.github.com/users/tony-spataro-rs/followers","following_url":"https://api.github.com/users/tony-spataro-rs/following{/other_user}","gists_url":"https://api.github.com/users/tony-spataro-rs/gists{/gist_id}","starred_url":"https://api.github.com/users/tony-spataro-rs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tony-spataro-rs/subscriptions","organizations_url":"https://api.github.com/users/tony-spataro-rs/orgs","repos_url":"https://api.github.com/users/tony-spataro-rs/repos","events_url":"https://api.github.com/users/tony-spataro-rs/events{/privacy}","received_events_url":"https://api.github.com/users/tony-spataro-rs/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-06-18T22:13:49Z","updated_at":"2015-06-19T19:09:23Z","closed_at":null,"body":"I appreciate that this might not be a bug in Bundler per se, but it's exasperating for those of us who still maintain Rails 2 apps, so I thought I'd report it and see if there's any advice on a workaround.\r\n\r\nIt seems that Rails 2 calls `Gem::DependencyList#dependency_order` while locating gems that host a plugin. This method does not appear to be deprecated, or at least the [stdlib docs](http://ruby-doc.org/stdlib-2.1.6/libdoc/rubygems/rdoc/Gem/DependencyList.html#method-i-dependency_order) for Ruby 2.1.6 don't mention it. However, it results in an exception (see backtrace below).\r\n\r\nAny advice on how to overcome this would be greatly appreciated; I'd hate to be locked into using an older Bundler version. If there's a more modern, supported way to sort specs in dependency order, then I'll be happy to monkey-patch that into my app.\r\n\r\n```\r\n    $ bundle exec script/console\r\n    Loading development environment (Rails 2.3.18)\r\n    /Users/tony/.rbenv/versions/2.1.6/lib/ruby/2.1.0/rubygems/dependency_list.rb:214:in `sort': comparison of Bundler::StubSpecification with Gem::Specification failed (ArgumentError)\r\n    \tfrom /Users/tony/.rbenv/versions/2.1.6/lib/ruby/2.1.0/rubygems/dependency_list.rb:214:in `tsort_each_child'\r\n    \tfrom /Users/tony/.rbenv/versions/2.1.6/lib/ruby/2.1.0/tsort.rb:411:in `call'\r\n    \tfrom /Users/tony/.rbenv/versions/2.1.6/lib/ruby/2.1.0/tsort.rb:411:in `each_strongly_connected_component_from'\r\n    \tfrom /Users/tony/.rbenv/versions/2.1.6/lib/ruby/2.1.0/tsort.rb:347:in `block in each_strongly_connected_component'\r\n    \tfrom /Users/tony/.rbenv/versions/2.1.6/lib/ruby/2.1.0/rubygems/dependency_list.rb:210:in `each'\r\n    \tfrom /Users/tony/.rbenv/versions/2.1.6/lib/ruby/2.1.0/rubygems/dependency_list.rb:210:in `tsort_each_node'\r\n    \tfrom /Users/tony/.rbenv/versions/2.1.6/lib/ruby/2.1.0/tsort.rb:345:in `call'\r\n    \tfrom /Users/tony/.rbenv/versions/2.1.6/lib/ruby/2.1.0/tsort.rb:345:in `each_strongly_connected_component'\r\n    \tfrom /Users/tony/.rbenv/versions/2.1.6/lib/ruby/2.1.0/tsort.rb:280:in `strongly_connected_components'\r\n    \tfrom /Users/tony/.rbenv/versions/2.1.6/lib/ruby/2.1.0/tsort.rb:255:in `strongly_connected_components'\r\n    \tfrom /Users/tony/.rbenv/versions/2.1.6/lib/ruby/2.1.0/rubygems/dependency_list.rb:75:in `dependency_order'\r\n    \tfrom /Users/tony/.rbenv/versions/2.1.6/lib/ruby/gems/2.1.0/gems/rails-2.3.18/lib/rails/plugin/locator.rb:94:in `plugins'\r\n    \tfrom /Users/tony/.rbenv/versions/2.1.6/lib/ruby/gems/2.1.0/gems/rails-2.3.18/lib/rails/plugin/loader.rb:109:in `block in locate_plugins'\r\n    \tfrom /Users/tony/.rbenv/versions/2.1.6/lib/ruby/gems/2.1.0/gems/rails-2.3.18/lib/rails/plugin/loader.rb:108:in `map'\r\n    \tfrom /Users/tony/.rbenv/versions/2.1.6/lib/ruby/gems/2.1.0/gems/rails-2.3.18/lib/rails/plugin/loader.rb:108:in `locate_plugins'\r\n    \tfrom /Users/tony/.rbenv/versions/2.1.6/lib/ruby/gems/2.1.0/gems/rails-2.3.18/lib/rails/plugin/loader.rb:32:in `all_plugins'\r\n    \tfrom /Users/tony/.rbenv/versions/2.1.6/lib/ruby/gems/2.1.0/gems/rails-2.3.18/lib/rails/plugin/loader.rb:22:in `plugins'\r\n    \tfrom /Users/tony/.rbenv/versions/2.1.6/lib/ruby/gems/2.1.0/gems/rails-2.3.18/lib/rails/plugin/loader.rb:53:in `add_plugin_load_paths'\r\n    \tfrom /Users/tony/.rbenv/versions/2.1.6/lib/ruby/gems/2.1.0/gems/rails-2.3.18/lib/initializer.rb:294:in `add_plugin_load_paths'\r\n    \tfrom /Users/tony/.rbenv/versions/2.1.6/lib/ruby/gems/2.1.0/gems/rails-2.3.18/lib/initializer.rb:136:in `process'\r\n    \tfrom /Users/tony/.rbenv/versions/2.1.6/lib/ruby/gems/2.1.0/gems/rails-2.3.18/lib/initializer.rb:113:in `run'\r\n    \tfrom /Users/tony/Code/rails23-bundler-bug/config/environment.rb:100:in `<top (required)>'\r\n    \tfrom /Users/tony/.rbenv/versions/2.1.6/lib/ruby/2.1.0/irb/init.rb:286:in `require'\r\n    \tfrom /Users/tony/.rbenv/versions/2.1.6/lib/ruby/2.1.0/irb/init.rb:286:in `block in load_modules'\r\n    \tfrom /Users/tony/.rbenv/versions/2.1.6/lib/ruby/2.1.0/irb/init.rb:284:in `each'\r\n    \tfrom /Users/tony/.rbenv/versions/2.1.6/lib/ruby/2.1.0/irb/init.rb:284:in `load_modules'\r\n    \tfrom /Users/tony/.rbenv/versions/2.1.6/lib/ruby/2.1.0/irb/init.rb:20:in `setup'\r\n    \tfrom /Users/tony/.rbenv/versions/2.1.6/lib/ruby/2.1.0/irb.rb:380:in `start'\r\n    \tfrom /Users/tony/.rbenv/versions/2.1.6/bin/irb:11:in `<main>'\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/bundler/bundler/issues/comments/113610120","html_url":"https://github.com/bundler/bundler/issues/3762#issuecomment-113610120","issue_url":"https://api.github.com/repos/bundler/bundler/issues/3762","id":113610120,"user":{"login":"tony-spataro-rs","id":4257476,"avatar_url":"https://avatars.githubusercontent.com/u/4257476?v=3","gravatar_id":"","url":"https://api.github.com/users/tony-spataro-rs","html_url":"https://github.com/tony-spataro-rs","followers_url":"https://api.github.com/users/tony-spataro-rs/followers","following_url":"https://api.github.com/users/tony-spataro-rs/following{/other_user}","gists_url":"https://api.github.com/users/tony-spataro-rs/gists{/gist_id}","starred_url":"https://api.github.com/users/tony-spataro-rs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tony-spataro-rs/subscriptions","organizations_url":"https://api.github.com/users/tony-spataro-rs/orgs","repos_url":"https://api.github.com/users/tony-spataro-rs/repos","events_url":"https://api.github.com/users/tony-spataro-rs/events{/privacy}","received_events_url":"https://api.github.com/users/tony-spataro-rs/received_events","type":"User","site_admin":false},"created_at":"2015-06-19T19:09:23Z","updated_at":"2015-06-19T19:09:23Z","body":"That observation about comparability led me to try the following solution, which *does* fix the issue in my Rails app (and is a bit cleaner than my first attempt at comparability).\r\n\r\n```diff\r\ndiff --git a/lib/bundler/remote_specification.rb b/lib/bundler/remote_specification.rb\r\nindex c80eaa4..c2c29bd 100644\r\n--- a/lib/bundler/remote_specification.rb\r\n+++ b/lib/bundler/remote_specification.rb\r\n@@ -8,6 +8,7 @@ module Bundler\r\n   # full specification will only be fetched when necessary.\r\n   class RemoteSpecification\r\n     include MatchPlatform\r\n+    include Comparable\r\n \r\n     attr_reader :name, :version, :platform\r\n     attr_accessor :source, :remote\r\n@@ -33,6 +34,14 @@ module Bundler\r\n       end\r\n     end\r\n \r\n+    def <=>(other)\r\n+      if other.respond_to?(:full_name)\r\n+        full_name <=> other.full_name\r\n+      else\r\n+        super\r\n+      end\r\n+    end\r\n+\r\n     # Because Rubyforge cannot be trusted to provide valid specifications\r\n     # once the remote gem is downloaded, the backend specification will\r\n     # be swapped out.\r\n```"}}