Guard won't load WDM

浪子不回头ぞ 提交于 2019-12-05 04:18:17

So here's what happened. By default, on Windows, Listen is supposed to use polling to check for filesystem changes. For some reason it was trying to use WDM. So, I had to had this to my Gemfile:

require 'rbconfig'
gem 'wdm', '>= 0.1.0' if RbConfig::CONFIG['target_os'] =~ /mswin|mingw/i

Maybe Guard makes Listen try to use WDM?

Can't find where I got this recommendation from, but I was given the following for running guard across windows and linux:

gem 'rb-inotify', github: 'nex3/rb-inotify', platforms: :ruby, require: false
gem 'wdm', platforms: :mingw, require: false

The false's make it so the gems are only attempted to be loaded when running on that platform. Your windows environment may need mswin instead of mingw, depending on which ruby install you're using.

Like said Binary Phile If you use rails in both windows and unix-like, you should use this in your Gemfile :

gem 'wdm','>= 0.1.0', platforms: [:mingw, :mswin, :x64_mingw, :jruby]

it works fine and it's readable.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!