注释gem和铁轨3.1

有没有人知道为什么注释在rails 3.1中不再起作用?

尝试运行时:

$ rvmsudo bundle exec annotate --position before 

鉴于我在我的gemfile中有以下内容:

 gem "annotate", '2.4.0' 

我收到以下错误:

  /usr/local/rvm/gems/ruby-1.9.2-p180@rails31/gems/activerecord-3.1.0/lib/active_record /railties/databases.rake:3:in `': undefined method `namespace' for main:Object (NoMethodError) 

我正在使用RVM和专用于带有Ruby 1.9.2的rails 3.1的gemset

已经有针对此问题的补丁: https : //github.com/ctran/annotate_models/commit/8057b920968a4c64c7d558e43834f81867329fcc

你应该使用最新版本:

 gem 'annotate', :git => 'git://github.com/ctran/annotate_models.git' 

最好成绩,

更新:它已在RubyGems的最新测试版中修复。 使用:

  gem 'annotate', '~> 2.4.1.beta' 

感谢Michael Hartl提供此信息。