繁体   English   中英

守护注释宝石不起作用

[英]guard-annotate gem is not working

宝石文件

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

保护文件

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注释-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

我在这里找不到任何结果,但可以找到一些处理过程。如何解决此问题? 我应该在哪里看到带注释的结果?

宝石文件

宝石“ rails”,“ 3.1.0”宝石“ rake”,“ 0.8.7”

组:发展做宝石“注释”,“ 2.5.0”结束

命令行:

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

Guard批注未实现run_all插件API ,因此run all对批注Guard无效。

我不知道带注释的gem,但是从快速的外观来看,它似乎总能注释每个模型并且没有选择性的重新生成,因此您只需触发一个文件更改即可,例如

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

这应该运行注释。

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

def run_all
  run_annotate
end

这使您可以将annotate到Guard命令提示符下以运行注释。

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

要么

您可以为jquery-ui使用gem "jquery-ui-rails" 有关更多信息,请访问git存储库

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

//= require jquery.ui.all

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

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

希望这可以帮助您

您是在命令提示符下运行此程序吗? 如果是这样,请尝试bundle exec注释用户以使用捆绑的gem,而不是系统的gem。

宝石被称为“注释”或“注释模型”吗?

它不是注释宝石吗? 它的github存储库称为annotate_models。

注释模型gem不同,并且已经有一段时间没有更新了。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM