注释命令不起作用,将它添加到我的gemfile中 [英] annotate command not working, added it to my gemfile
问题描述
group:development,:test do
gem'rspec-rails'
gem'annotate-models','1.0.4'
end
我运行了' bundle install
',它安装了annotate-models bundle。
如果输入:<$ c
如果我键入: 如果我键入bundle show annotate-models,它表示它安装在: bundle show annotate $> c $ c>我在当前包中找不到gem annotate。
/Library/Ruby/Gems/1.8/gems/annotate-models-1.0.4
$ b
输入:
annotate-models
也不起作用。
我是
编辑:更好的版本(使用Bundler只安装它r当前项目)
- 将Gem'annotate'添加到Gemfile
- 运行
$ bundle install
- 运行
$ bundle exec annotate $编辑2:似乎你现在必须显式指定注释版本,所以在Gemfile中放置
- 运行
$ sudo gem install annotate
- 添加
gem'注释
为Gemfile - 运行
$ bundle install
运行 - 请高兴:)
- Add
gem 'annotate'
to Gemfile - Run
$ bundle install
- Run
$ bundle exec annotate
- Run
$ sudo gem install annotate
- Add
gem 'annotate'
to Gemfile - Run
$ bundle install
- Run
$ annotate
- Be happy :)
gem'annotate','2.4.1.beta1'(这是一个预发布的测试版宝石,可与最新版本的activerecord一起使用,而不是直接指定github repo)
Edit3:2.5.0 final现在已经出来,所以希望不需要再强制一个测试版,只需要获得最新的应用即可!
<旧版本(在系统级别安装gem):
如果运行Rails 3,演练是:
$ annotate $ c
My gem file looks like:
group :development, :test do
gem 'rspec-rails'
gem 'annotate-models', '1.0.4'
end
I ran 'bundle install
' and it installed the annotate-models bundle.
If I type: annotate
I get a command not found error.
If I type: bundle show annotate
I get a 'could not find gem annotate in the current bundle.
If I type bundle show annotate-models it says it installed in:
/Library/Ruby/Gems/1.8/gems/annotate-models-1.0.4
typing:
annotate-models
doesn't work either.
I'm following along in railstutorial.org and got stuck at this point.
Edit: Better version (using Bundler to install it only for the current project)
Edit2: Seems you have to explicitly specify annotate version for now, so in Gemfile put gem 'annotate', '2.4.1.beta1'
(which is a prereleased beta gem that works with the latest version of activerecord as opposed to specifying the github repo directly)
Edit3: 2.5.0 final is out now, so hopefully no need to force a beta version any more, just getting the latest should work!
Old version (with installing the gem on a system level too):
If running Rails 3 the drill is:
这篇关于注释命令不起作用,将它添加到我的gemfile中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!