-
Notifications
You must be signed in to change notification settings - Fork 246
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
Problems on Windows #149
Comments
Could you please checkout Listen master and try to run the spec suite with |
|
Ok same as before, if you launch just some specific specs:
|
|
Ok if this specs work, I really don't understand why you got
with As I don't have a Windows machine with c extension working I'm not able to debug Regarding polling being slow, try to ignore a maximum of useless files and change latency option. |
I just release 2.1.1 with a fix on adapter, could you please give it a try with |
Same result sorry - i.e. looks like its working at then exits - as per output above. Will stick to 1.8.3 for the time being and will have a look at the wdm adapter when I get a chance |
Ok thanks. |
After reading this I dropped back to 1.8.3 to test and it's working so far with sass and livereload. |
listen 2.2.0 I can verify that simply running the Listen example in the readme, ie:
... if With |
Just did the same as @nilliams by gem update followed by gem uninstall wdm and I get the following message
It works like this but is extremely slow. Up to 8 second compile plus another 3 or 4 seconds for livereload to show the change in chrome. At least with the older versions in my previous comment the change showed in the browser in 1-2 seconds. So does this mean the problem can be narrowed down to wdm? If that was fixed so wdm could be re-installed would it speed up guard? Sorry I don't know much about how it all works. |
@isimmons yes with |
Confirming same problem with guard 2.2.3, listen 2.2.0, wdm 0.1.0, ruby 1.9.3 -- silent exit |
Still an issue? |
I just started using spork and guard and found this issue when my guard process was just exiting instead of continuing to watch for changes, so barring some config issue on my part, this is still an issue. This is my gemfile: source 'https://rubygems.org'
ruby '1.9.3'
gem 'rails', '4.0.3'
gem 'pg'
group :development, :test do
gem 'rspec-rails', '2.13.1'
gem 'guard-rspec', '2.5.0'
gem 'spork-rails', '4.0.0'
gem 'guard-spork', '1.5.0'
gem 'childprocess', '0.5.1'
end
group :test do
gem 'selenium-webdriver', '2.35.1'
gem 'capybara', '2.1.0'
gem 'rb-notifu', '0.0.4'
gem 'win32console', '1.3.2'
gem 'wdm', '0.1.0'
end
gem 'sass-rails', '4.0.1'
gem 'uglifier', '2.1.1'
gem 'coffee-rails', '4.0.1'
gem 'jquery-rails', '3.0.4'
gem 'turbolinks', '1.1.1'
gem 'jbuilder', '1.0.2'
group :doc do
gem 'sdoc', '0.3.20', require: false
end
group :production do
gem 'rails_12factor', '0.0.2'
end This is the output from rubymine when i run guard:
and my guardfile which i've simplified to eliminate variables: # A sample Guardfile
# More info at https://github.com/guard/guard#readme
require 'active_support/inflector'
group :spec do
guard :rspec, all_after_pass: false, cli: '--drb' do
watch(%r{^spec/.+_spec\.rb$})
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
watch('spec/spec_helper.rb') { "spec" }
end
end This is my first day with guard and spork so I'm more than willing to admit it's a config issue on my part. I set this up while following the tutorial here: http://ruby.railstutorial.org/chapters/static-pages#sec-guard |
@zetas I'm sorry but I've never use Spork and Guard on Windows, never see the error either. |
I need to get a frickin mac |
@zetas that sounds like a great idea. And use Spring instead of Spork! |
Get the same result as @nilliams on If i use the example given in wdm repo (https://github.com/Maher4Ever/wdm/blob/master/example/changes_monitor.rb), it work. see gist https://gist.github.com/net1957/7947e78ce2b6bb13b113
|
@net1957 could you try to run the spec suite of Listen on your system and copy/paste the result here. Thanks! |
I am using windows 8.1 and in my case everything is working fine when I use --force-polling option but it is very slow. Takes 4-5 mins to refresh the browser. It works fine on my iMac but I really need to get it working on my windows laptop. |
To run it on windows I removed the first "/" in Pathname in silencer_spec.rb
without that I get this error
|
I've used |
I can confirm that using the standard command prompt instead of git bash and using the wdm config as stated above works. Using a completely updated bundle. Listen still throws a warning though about adding wdm config to my gemfile. |
Thanks guys! And thanks for your help, too. Let me know if you have other issues - even minor edge cases. @andregriffin - that's strange. Are you absolutely sure you're using bundler 1.6.2? Could you try putting this into your result = RbConfig::CONFIG['target_os'] =~ /mswin|mingw|cygwin/i
if result
STDERR.puts "wdm loading on: #{RbConfig::CONFIG['target_os']} (#{result.inspect})"
gem 'wdm', '>= 0.1.0'
else
STDERR.puts "wdm not loading on: #{RbConfig::CONFIG['target_os']} (#{result.inspect})"
end I just can't imagine how this can not work. |
I am using bundler 1.6.2. Using
Pasting what you gave into my gemfile produces this:
Just fails after LiveReload tries to connect, as it has always done... |
@andregriffin, could you set the environment variable It's strange if LiveReload fails because of a config check in the Gemfile - definitely seems like an unrelated issue... |
We use Listen to handle file changes in Jekyll and are running into serious problems with Listen on Windows.
An array of issues, even up to v2.7.7. Seems like 2.6.0 worked ok, 2.7.5 is broken, 2.7.6 works for some, and 2.7.7 breaks everything. Is this Listen or WDM's problem? |
@parkr - as far as I know, everything should work. Let's tackle this one by one - pick an issue (most serious first is ok) and run with Also, Listen hijacks Celluloid's logger (because it's async, etc.) and Celluloid can either show irrelevant errors or silence them and show nothing, so:
Running with the debug flag set should help me quickly identify the cause. |
Overall, Windows is a poor platform for development, while the WDM is a great job and there's no active support for Windows in Listen (should work, though it's not actively tested and none of the core devs uses Windows, there's no build options for Windows on Travis, etc.). The current released version is expected to work - and I wouldn't consider any other version. If it doesn't work, it's a bug and I don't know about it. |
@e2 Thanks for getting back to me so quickly! Didn't know |
@parkr - it's described in the (long) README. Even if the problem isn't with Listen, it's useful for debugging everything else too - and especially for extracting fixtures and test/edge cases. Listen does a ton of complex stuff under the hood, each platform has little in common with the others (in terms of how it works, possible bugs and problems) and there a tons of possible edge-cases and race-conditions that aren't prevented or don't even have defined proper behavior... ... so don't hesitate to ask about anything. |
@e2 Seem to be running into a problem with
It's been reported twice today. Here's a stacktrace with the debugging env var turned on: jekyll/jekyll#2507 (comment) |
Looks like I didn't implement _log as a class method... doh... Either way, it's reporting that for some reason WDM failed to get required - either the wdm gem isn't installed, or it didn't get built/compiled (the Windows version of the gem should have a working compiled binary AFAIK). |
@parkr - v2.7.8 fixes this (it shows warning and falls back to polling instead of crashing) |
Excellent! Thanks a lot. |
@e2 - I believe that I'm experiencing the same or similar issue so any help would be appreciated. I'm running Drupal and the Omega theme which uses ruby and sass/compass to process the css files and update the browser. The issues are when running on a windows development stack Win 7 64bit The gemfile is source 'https://rubygems.org' group :development do Sass, Compass and extensions.gem 'sass' # Sass. Guardgem 'guard' # Guard event handler. Dependency to prevent polling. Setup for multiple OS environments.Optionally remove the lines not specific to your OS.https://github.com/guard/guard#efficient-filesystem-handlinggem 'rb-inotify', '~> 0.9', :require => false # Linux require 'rbconfig' The gemfile.lock is GEM PLATFORMS DEPENDENCIES If I call 'bundle exec guard --force-polling' Changes are detected and everything works however it runs the CPU's virtual core are 100% even though there is less than 100 files for it to check. If I call 'bundle exec guard' it just silently exits after it says it's monitoring the files. If I set the environment variable LISTEN_GEM_DEBUGGING=1 then it returns 16:10:21 - INFO - Guard::Compass is waiting to compile your stylesheets. With LISTEN_GEM_DEBUGGING=2 I get I, [2014-09-12T16:19:39.227017 #6116] INFO -- : Celluloid loglevel set to: 0 16:19:49 - INFO - Guard::Compass is waiting to compile your stylesheets. Very occasionally it does work without force polling but it's very rare but I can't find any pattern to replicate when it works. When it does work the CPU usage is neglible. I'm new to Ruby so if you have any ideas or advice (ideally other than don't use windows :)) it would be gratefully received. |
After some further experimentation it seems that I may have found a pattern for my setup. In my gemfile if I comment out the line gem 'wdm' line' like this require 'rbconfig' and then start it with bundle exec guard it starts as mentioned before and works ok. If after it starts I then type 'exit', uncomment the gem 'wdm' line like this require 'rbconfig' and then start it again with bundle exec guard it now works and it looks to be using wdm, cpu usage is very low and any changes are detected much more quickly (3 seconds versus about 10). If I exit this and try to restart it it silently exits at the start and this is regardless of how many times I try to restart it. The only thing that makes it work is to again comment out the gem 'wdm' line, start and exit it, uncomment it and then start it again. Hopefully this extra info may provide some extra clues. One other thing I note is that the livereload is unreliable if I have more than one browser window to the same dev site open at the same time. |
@Ollie222 - listen comes with a "listen" tool to just print files that change - without running guard, etc. Just run Because at this point, you want to know if the problem is with listen or guard. (After 'wdm - starting ...' you should see 'wdm - callback: (...)' whenever you change a watched file). Once listen is working perfectly by itself, we can work out what else could be wrong... |
@e2 - Thank you for the quick response. This is my first exposure to Ruby so I'm still learning a lot of the basics. If I just type listen at the command prompt then it just says 'Starting listen...' and then exists. I'm not sure if this is intended behaviour or not. In a new folder I've just added a gemfile with the following contents and called 'bundle install'. source 'https://rubygems.org' I've then created a file called test.rb and added the script below to it. require 'listen' When I run the above script it outputs the path name and then just sits there. If I add, delete or alter any files in the monitored directory then the file detail changes are shown in the terminal. If I have more than 58 files in the directory being monitored then the script starts and exits after a few seconds. Is there a memory setting that needs to be increased or does this provide any more clues as to what to test next? Thanks again for your help. |
@Ollie222 - if your scripts stops after a few seconds, it means something silently crashed. Just set the environment variable: |
Thanks again for your quick reply. With LISTEN_GEM_DEBUGGING=2 it gives the following output before exiting. I, [2014-09-15T15:12:05.946292 #11712] INFO -- : Celluloid loglevel set to: 0 It looks like it's starting wdm even though I've not got it specified in the gem file. With debugging on if I now have 53 or fewer items in the directory then it works with wdm, any more and it exits silently. If I change the listen.to to include force_polling:true then with debugging mode on it lists the file names in the specified directories every second or so and it looks to work with any number of files although it took about 30 seconds to check a folder with 22,000 files in it which I presume is to be expected. |
@Ollie222 - any strange names in the files? Other than that I have no clue at this point. You could try a newer version of Ruby maybe (to see if anything is different). Maybe even a 'bundle update' to make sure you have a newer version of Celluloid. You can try adding more debug statements in the adapters/windows.rb file - to see when it exits. Either way, your problem seems strange (you should at least see errors or something). When you have more than 53 files - does it exit even if you do nothing (i.e. no files changed)? |
I'm currently using 1.9.3 as this is what seems to be suggested as the most compatible but I'll try a later version of Ruby. Bundle update shows Fetching gem metadata from https://rubygems.org/........... I believe the above is about as up to date as available for stable versions. (I've added back in wdm) It either works perfectly with a smaller number of files or it just exits a second or so after starting before any file changes have taken place. Am I right in thinking that adapters.rb is part of compass, if so I don't think my test project uses it. I It certainly seems a bit of an odd issue and once again thanks for your time trying to help, I'll update the thread if I get anywhere. |
You can use Basically, you'd want to know whether the You could also try an earlier version of Listen (between 2.7.0 and master) - just to compare if it works any different (you won't see any debug messages - but you can check if it exits or not). Anyway, without some serious poking around with the wdm adapter ( (afterwards, |
Thanks for the advice. I've added a couple of debug messages to the windows.rb file.
When executed I now get wdm - starting... If I'm understanding correctly it's not calling and returning from watch_recursively which I believe is part of the wdm gem. Also the directory and file names are simple and making them shorter makes no difference to the maximum number of files. |
@Ollie222 - this probably needs compiling a debug version of wdm and/or putting debug statements there. Personally, I avoid Windows like the plague (and I have a grudge against Microsoft products), so it's unlikely I'll spend time helping you debug this on the wdm side. Of course, if there's anything I can fix in Listen itself (or provide a workaround), I'd be happy to. The best thing I can recommend is trying out Ruby 2.1.2 (or other versions) to see if there's any change (there were some memory allocation issues - see current/close wdm issues for possible info/tips, e.g. Maher4Ever/wdm#15). |
@e2 - Thanks for your advice again and I wasn't expecting you to fix the issue, you've given me lots to go on and issue does look to be with wdm and Windows. I have to use a number of different platforms for different projects but for this one getting it working on Windows would be useful. I will try out a later version of Ruby and also checkout the wdm issues list. I'll report back if I get anywhere. Once again thanks for your help. |
@Ollie222 - no problem. I hope I didn't come across as being irritated or something - I just have too many personal reasons not to get my hands dirty with this. While windows is a "user friendly" platform, it's also a very "developer-unfriendly" platform (IMHO). I feel sad for Windows users that they have so many exotic issues - and I feel for the independent developers out there spending tons of time trying to deal with them (I used to be one of them - ages ago) and getting almost no credit and/or long-term satisfaction. (I'm always astounded to see so many brilliant people doing incredible things to make Ruby apps and libraries work on Windows). Just to make myself clear - I'd love to make listen work perfectly on Windows (and I've spent a lot of time to make it work and keep it working) and thumbs up for anyone willing to dive into this. It's just that by being a "Windows repair-man" I feel like I'm contributing to the problem instead of fixing it. So while I don't want to get my hands dirty with this, I also don't want to discourage others from asking for help with similar issues and/or from making contributions in listen towards Windows support. |
This seems to affect Jekyll users under Windows (jekyll/jekyll#5629) |
Windows 7 32bit, Ruby 2.9, Compass 1.0.3, rb-inotify-0.10.1 |
If this problem persists with v3.3 and anyone's interested, let us know and we can reopen this issue. |
Notes:
--force-polling
option under windows by conditionally sniffing the target os viaRbConfig::CONFIG['target_os'] =~ /mswin|mingw|cygwin/i
and the guard daemon starts normally.Re: 1 Below is a stack trace when WDM is not included in Gemfile
Re: 2 When wdm is included in the bundle the daemon silently exits:
The contents of the Gemfile and Guardfile are available here: guard/guard#492
The text was updated successfully, but these errors were encountered: