version 0.4.1 of the declarative_authorization gem has rails >= 2.1.0 as a dependency. If you install rails 2.3.5 first, then install 0.4.1 of declarative_authorization, you get the dependencies of Rails 3. If declarative_authorization needs rails >= 2.1.0, if 2.3.5 is installed, that dependency should be satisfied, right? What causes all the other gems to be installed? Is this a rubygems bug?
$ ruby -v
ruby 1.8.7 (2010-04-19 patchlevel 253) [i686-darwin10.4.0], MBARI 0x6770, Ruby Enterprise Edition 2010.02
$ gem -v
1.3.7
$ gem install rails -v 2.3.5
Successfully installed rake-0.8.7
Successfully installed activesupport-2.3.5
Successfully installed activerecord-2.3.5
Successfully installed rack-1.0.1
Successfully installed actionpack-2.3.5
Successfully installed actionmailer-2.3.5
Successfully installed activeresource-2.3.5
Successfully installed rails-2.3.5
8 gems installed
$ gem install declarative_authorization -v 0.4.1
Successfully installed declarative_authorization-0.4.1
Successfully installed activesupport-3.0.3
Successfully installed builder-2.1.2
Successfully installed i18n-0.4.2
Successfully installed activemodel-3.0.3
Successfully installed rack-1.2.1
Successfully installed rack-test-0.5.6
Successfully installed rack-mount-0.6.13
Successfully installed tzinfo-0.3.23
Successfully installed abstract-1.0.0
Successfully installed erubis-2.6.6
Successfully installed actionpack-3.0.3
Successfully installed arel-2.0.4
Successfully installed activerecord-3.0.3
Successfully installed activeresource-3.0.3
Successfully installed mime-types-1.16
Successfully installed polyglot-0.3.1
Successfully installed treetop-1.4.9
Successfully installed mail-2.2.10
Successfully installed actionmailer-3.0.3
Successfully installed thor-0.14.4
Successfully installed railties-3.0.3
Successfully installed bundler-1.0.7
23 gems installed
$ gem dependency declarative_authorization
Gem declarative_authorization-0.4.1
rails (>= 2.1.0, runtime)
When you specify a version number using
>=for agem, Rubygems will always try to get the latest and greatest for that gem, regardless if the dependency is already satisfied. This is not a bug, but rather expected behavior. To fix this, the gem author should specify that the gem depends on any version of Rails 2 by doing this:
In summary, this is the gem author’s fault, not Rubygems.