【问题标题】:Guard no longer detecting file changes with Yosemite OSX 10.10Guard 不再检测 Yosemite OSX 10.10 的文件更改
【发布时间】:2015-04-16 02:00:30
【问题描述】:

我设置了 Yosemite 的全新安装,但在文件更改时无法检测到。

我的环境:

guard (2.6.1)
guard-minitest (2.2.0)
rubygems-bundler (1.4.4)
Ruby 1.9.3 and 2.0.0 both have been testing

这是调试的输出:

tom@Toms-MBP:~/Sites/tick (master)$ LISTEN_GEM_DEBUGGING=2 bundle exec guard -d
I, [2014-10-27T15:34:53.417196 #1059]  INFO -- : Celluloid loglevel set to: 0
15:34:53 - DEBUG - Command execution: emacsclient --eval '1' 2> /dev/null || echo 'N/A'
15:34:53 - INFO - Guard is using TerminalTitle to send notifications.
15:34:53 - DEBUG - Command execution: hash stty
15:34:53 - DEBUG - Guard starts all plugins
15:34:53 - DEBUG - Hook :start_begin executed for Guard::Minitest
15:34:53 - INFO - Guard::Minitest 2.3.2 is running, with Minitest::Unit 4.7.5!
15:34:53 - DEBUG - Hook :start_end executed for Guard::Minitest
15:34:53 - INFO - Guard is now watching at '/Users/tom/Dropbox/Sites/tick'
15:34:53 - DEBUG - Command execution: sysctl -n hw.ncpu
D, [2014-10-27T15:34:53.517668 #1059] DEBUG -- : Adapter: considering TCP ...
D, [2014-10-27T15:34:53.517749 #1059] DEBUG -- : Adapter: considering polling ...
D, [2014-10-27T15:34:53.517776 #1059] DEBUG -- : Adapter: considering optimized backend...
I, [2014-10-27T15:34:53.587089 #1059]  INFO -- : Record.build(): 0.06837701797485352 seconds
15:34:53 - DEBUG - Command execution: stty -g 2>/dev/null
15:34:53 - DEBUG - Start interactor
[1] guard(main)>

我不确定如何测试底层的 listen gem,但似乎它必须是相关的。我已经确认警卫可以正常使用轮询 (bundle exec guard start --force-polling)。

【问题讨论】:

    标签: ruby-on-rails guard


    【解决方案1】:

    我能够通过将文件移出 Dropbox 来解决我的问题。一旦我看到这个工作,我就知道 Dropbox 以某种方式导致了文件系统的问题。我通过删除文件夹并通过 Dropbox 重新添加解决了这个问题,现在一切正常。

    【讨论】:

      【解决方案2】:

      我遇到了同样的问题,多亏了 LiveReload 应用程序发出的警告,我才修复了它。 因为问题不受 Dropbox 和/或 ruby​​ on rails 的限制,所以我想分享一下我所做的:

      • 重命名有问题的文件夹(在我的例子中包含 Guardfile)
      • 使用旧文件夹名称创建新文件夹
      • 将文件从旧文件夹移动到新文件夹

      LiveReload 提到的其他解决方案有:

      • 重新启动计算机
      • 通过磁盘工具检查磁盘并修复权限
      • 将文件夹添加到 Spotlight 隐私列表(不索引的文件夹列表),然后从中删除,有效地强制 重新索引
      • 重命名文件夹,然后可能重新命名
      • 重新创建文件夹并将旧内容移回其中

      阅读更多:http://feedback.livereload.com/knowledgebase/articles/86239

      这不仅解决了我的 Guard 问题,还允许Compass watch 再次运行。

      【讨论】:

        【解决方案3】:

        你添加了 rb-fsevent gem 吗?

        group :development, :test do
          gem 'rb-fsevent' if `uname` =~ /Darwin/
        end
        

        如果您使用的是 OS X,它将使用 OS X FSEvents API。

        【讨论】:

          猜你喜欢
          • 2014-07-28
          • 2014-12-15
          • 1970-01-01
          • 2014-12-17
          • 1970-01-01
          • 2015-06-14
          • 2014-12-25
          • 1970-01-01
          • 2015-01-04
          相关资源
          最近更新 更多