Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

forge watch doesn't work in some VM's (e.g.: Vagrant with VirtualBox) #71

Closed
audionerd opened this issue Aug 16, 2013 · 1 comment
Closed

Comments

@audionerd
Copy link
Contributor

When Guard is run on some VM's (e.g.: Vagrant with VirtualBox), the Listen gem will only pick up filesystem changes if polling is forced.

Here's the bug report for Listen: guard/listen#57

It's possible this might be fixed in later versions of Guard/Listen, but Forge is on ~> 1.3.0 right now.

While looking for a workaround, I found that ::Forge::Guard::start accepts options, but doesn't seem to pass any arguments to ::Guard.start.

So, the best I could come up with was this monkeypatch, which forces polling when included in config.rb:

module ::Guard
  class << self
    alias_method :old_start, :start

    def start(options = {})
      options = options.merge({ "force_polling" => true })
      ::Guard::UI.info "Added `force_polling` to Guard options"

      self.old_start(options)
    end
  end
end

With this code pasted into config.rb, I can run forge watch on a Vagrant and see changes trigger a (slightly-delayed) reload.

@dstrojny
Copy link

This is great Eric! Thanks so much for helping out. I'd think the best plan might be to try the later versions of Guard, and if that doesn't work, we could maybe add this patch.

Would you mind sending me an email (dstrojny at jestro.com)? I'd love to chat more about Forge with you.

@ghost ghost closed this as completed Jul 31, 2020
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants