-
Notifications
You must be signed in to change notification settings - Fork 35
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
Using Listen on Rails root spams errors on local symlinks #8
Comments
https://github.com/jonleighton/spring-watcher-listen/blob/master/lib/spring/watcher/listen.rb#L58 You can probably try monkey patching this method to set your own set of dirs to avoid rewatching the symlinked dirs. |
Thanks for the suggestion @e2. I spent some time trying the suggested patch, but unfortunately it looks like avoiding a watch on the project root is not possible. Spring must watch |
Actually, I managed to workaround the
Along with this monkey-patch that removes the root from the
This allows my project to successfully load |
- Move Gemfile, Gemfile.lock, deployment.rb out of project root via symlink (cf. guard/listen#273)
Looks really good to me - Removing watching the root directory is the right way to avoid performance problems on OSX, because sadly In fact, the reason to use symlinks is to avoid watching the root directory for large Rails projects on OSX. Summary: OSX-specific optimizations in Listen can mitigate the performance problems - and this would remove the need for warnings to begin with. Polling has a similar problem, though. |
Hi guys, I had the same problem that @wjordan had and after an unsuccessful monkey patch I ended up in here. Should I be looking at guard/listen instead? |
@goncalvesjoao - figure out a way to not watch symlinked directories. I don't know what your project layout is, so I can't help much. There might be a better way of organizing your project - but that's project specific. (E.g. why exactly do you need symlinks? Maybe you can configure one tool to reference the original files instead of telling it to use the symlinked location?). As a quick (but detrimental?) workaround, just copy the files physically instead of symlinking them. In short: watching directories and their symlinked version isn't supported. It's complex - rocket-science level. (It's impossible to handle symlinks in a way to make everyone happy). So the rule of thumb is: avoid using symlinks when watching files. (The other option is: you can hire someone to add support for your exact situation in Listen - just saying it's ungrateful work otherwise). |
I had the following error on my development environment:
I solved it by removing my local bundler cache: bundle config --delete BUNDLE_CACHE_ALL
rm -rf vendor/cache/ |
I was able to get rid of the errors by using this monkey patch:
|
Hello, I'm attempting to use spring-watcher-listen in a large Rails project containing several local symlinks, all of which serve a specific purpose and cannot be removed. Using
spring-watcher-listen
with recent versions oflisten
(since guard/listen#273), loadingspring
spams the following error once for every local symlink in the project:In response to the issue guard/listen#339 I opened, @e2 suggested that my case might in fact be better solved by patching spring-watcher-listen to call that library more appropriately:
Does this suggestion sound correct? If so, any ideas on whether/how it would be possible to patch this library to watch a more selective set of files, in order to resolve this local-symlink error-spam issue in recent versions of Listen?
The text was updated successfully, but these errors were encountered: