Annotate gem and rails 3.1

给你一囗甜甜゛ 提交于 2019-12-03 10:43:09

问题


Does anyone have any idea why annotate does not work anymore in rails 3.1 ?

When trying to run it with :

 $ rvmsudo bundle exec annotate --position before

and given I've got the following in my gemfile:

gem "annotate", '2.4.0'

I get the following error:

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

I'm using RVM with a gemset dedicated to rails 3.1 with Ruby 1.9.2


回答1:


There's already a patch for this issue: https://github.com/ctran/annotate_models/commit/8057b920968a4c64c7d558e43834f81867329fcc

You should use the last version:

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

Bests,

UPDATE: It's fixed in the latest beta version at RubyGems. Use:

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

Thanks to Michael Hartl for this information.



来源:https://stackoverflow.com/questions/7295505/annotate-gem-and-rails-3-1

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!