guard / listen

The Listen gem listens to file modifications and notifies you about the changes.
https://rubygems.org/gems/listen
MIT License
1.92k stars 246 forks source link

wdm install advice on Windows could be improved #451

Closed belluzj closed 3 years ago

belluzj commented 6 years ago

I'm working on a Rails app and developing on Windows. I got advice to add wdm to my Gemfile and did as instructed, but this resulted later in a problem when deploying the same Rails app on a Linux machine, where bundler complained:

You are trying to install in deployment mode after changing
your Gemfile. Run `bundle install` elsewhere and add the
updated Gemfile.lock to version control.

If this is a development machine, remove the /usr/src/app/Gemfile freeze 
by running `bundle config --delete frozen`.

You have deleted from the Gemfile:
* wdm (>= 0.1.0)

I fixed the issue by changing my Gemfile:

-gem 'wdm', '>= 0.1.0' if Gem.win_platform?
+gem 'wdm', '>= 0.1.0', platforms: [:x64_mingw]

From what I understand, that way bundler knows that the gem is only needed on windows and can be smart about it. Maybe you could update the advice message that you display? However the platform symbol (:x64_mingw) may be different for each Ruby-on-Windows install.

FrankFang commented 5 years ago

Thanks! It helps. My config:

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