guard-annotate gem不起作用

时间:2014-01-28 05:19:52

标签: ruby-on-rails ruby ruby-on-rails-3 guard

的Gemfile

gem 'annotate'
gem 'guard'
gem 'guard-annotate'

Guardfile

guard 'annotate', :run_at_start => false do
  watch( 'db/schema.rb' )

  # Uncomment the following line if you also want to run annotate anytime
  # a model file changes
  watch( 'app/models/*.rb' )

  # Uncomment the following line if you are running routes annotation
  # with the ":routes => true" option
  watch( 'config/routes.rb' )
end

当我运行“注释”(没有后卫)时,它运行良好。当我守卫时,我发现守卫注释不起作用。

这是跟踪

$ 捆绑执行警卫

09:33:56 - INFO - Guard is using NotifySend to send notifications.
09:33:56 - INFO - Guard is using TerminalTitle to send notifications.
09:33:56 - INFO - Guard is now watching at '/home/user/work/projects/a/alumni-not'
[1] guard(main)> 
09:34:56 - INFO - Run all
[2] guard(main)> 
09:34:56 - INFO - Run all
[3] guard(main)> 

调试跟踪

$ bundle exec guard --plugin annotate -d

16:48:13 - DEBUG - Command execution: emacsclient --eval '1' 2> /dev/null || echo 'N/A'
16:48:13 - INFO - Guard is using Libnotify to send notifications.
16:48:13 - INFO - Guard is using TerminalTitle to send notifications.
16:48:13 - DEBUG - Command execution: hash stty
16:48:13 - DEBUG - Guard starts all plugins
16:48:13 - DEBUG - Hook :start_begin executed for Guard::Annotate
16:48:13 - DEBUG - Hook :start_end executed for Guard::Annotate
16:48:13 - INFO - Guard is now watching at '/home/user/work/projects/a/alumni-not'
16:48:13 - DEBUG - Start interactor
[1] Annotate guard(main)> 
16:48:23 - INFO - Run all
16:48:23 - DEBUG - Hook :run_all_begin executed for Guard::Annotate
16:48:23 - DEBUG - Hook :run_all_end executed for Guard::Annotate

我在这里找不到任何结果,但我可以找到一些流程。我怎么能解决这个问题?我应该在哪里看到注释结果?

5 个答案:

答案 0 :(得分:0)

的Gemfile

gem“rails”,“3.1.0” 宝石“耙”,“0.8.7”

组:开发做   gem“annotate”,“2.5.0” 端

命令行:

$ gem install annotate 已成功安装annotate-2.5.0 已安装1个宝石

答案 1 :(得分:0)

警卫注释does not implement the run_all plugin API,因此对注释Guard执行all all无效。

我不知道注释宝石,但从快速看看它似乎总是注释每个模型并且没有选择性再生,所以你只需触发单个文件更改,如

[1] guard(main)> c db/schema.rb

这应该运行注释。

另一种选择是发送拉取请求以实现run_all方法,如:

def run_all
  run_annotate
end

这允许您将annotate写入Guard命令提示符以运行注释。

答案 2 :(得分:-1)

使用特定版本的gem "jquery-rails", "~> 2.3.0",因为更新版本的gem已删除了ui部分。

您可以将"jquery-ui-rails"用于jquery-ui。有关更多信息,请访问git存储库

要求所有jQuery UI模块,请将以下内容添加到application.js:

//= require jquery.ui.all

还将jQuery UI CSS添加到application.css:

/*
 *= require jquery.ui.all
 */

希望这可以帮到你

答案 3 :(得分:-2)

您是否从命令提示符运行此命令?如果是这样,请尝试捆绑exec注释用户使用捆绑的宝石而不是系统宝石。

并且是名为'annotate'或'annotate-models'的宝石?

答案 4 :(得分:-2)

它不应该是注释宝石吗?它的github repo叫做annotate_models。

annotate-models gem是不同的,并且暂时没有更新。

相关问题