注释命令不起作用,将它添加到我的gemfile中 [英] annotate command not working, added it to my gemfile

查看:134
本文介绍了注释命令不起作用,将它添加到我的gemfile中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

  group:development,:test do 
gem'rspec-rails'
gem'annotate-models','1.0.4'
end

我运行了' bundle install ',它安装了annotate-models bundle。



如果输入:<$ c

如果我键入: bundle show annotate c $ c>我在当前包中找不到gem annotate。

如果我键入bundle show annotate-models,它表示它安装在:

  /Library/Ruby/Gems/1.8/gems/annotate-models-1.0.4 

p
$ b

输入:

  annotate-models 

也不起作用。



我是

解决方案

编辑:更好的版本(使用Bundler只安装它r当前项目)


  1. 将Gem'annotate'添加到Gemfile

  2. 运行 $ bundle install

  3. 运行 $ bundle exec annotate

  4. gem'annotate','2.4.1.beta1'
    (这是一个预发布的测试版宝石,可与最新版本的activerecord一起使用,而不是直接指定github repo)

    Edit3:2.5.0 final现在已经出来,所以希望不需要再强制一个测试版,只需要获得最新的应用即可!



    <旧版本(在系统级别安装gem):



    如果运行Rails 3,演练是:


    1. 运行 $ sudo gem install annotate

    2. 添加 gem'注释为Gemfile

    3. 运行 $ bundle install
    4. 运行 $ annotate
    5. 请高兴:)


    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)

    1. Add gem 'annotate' to Gemfile
    2. Run $ bundle install
    3. Run $ bundle exec annotate

    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:

    1. Run $ sudo gem install annotate
    2. Add gem 'annotate' to Gemfile
    3. Run $ bundle install
    4. Run $ annotate
    5. Be happy :)

    这篇关于注释命令不起作用,将它添加到我的gemfile中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆