declarative_authorization gem的0.4.1版本具有rails> = 2.1.0作为依赖项。如果先安装rails 2.3.5,然后安装0.4.1的declarative_authorization,你就得到了Rails 3的依赖关系。如果declarative_authorization需要rails> = 2.1.0,如果安装了2.3.5,那么应该满足那个依赖关系吧?是什么导致所有其他宝石安装?这是一个rubygems错误吗?
$ 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)
答案 0 :(得分:0)
这令人费解。
可能是declarative_authorization gem依赖于一些错误依赖rails3的其他gem。我注意到一个宝石开始使用ActiveSupport 3的一些新功能,并打破了整个链。
答案 1 :(得分:0)
使用>=
为a指定版本号时
gem,Rubygems将始终尝试为该gem获取最新和最好的内容,无论该依赖项是否已经满足。这不是错误,而是预期的行为。要解决这个问题,gem作者应该通过这样做指定gem依赖于任何版本的Rails 2:
s.add_dependency 'rails', '~> 2'
总之,这是宝马作者的错,而不是Rubygems。