Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

`--watch` exits silently #2320

Closed
XhmikosR opened this Issue · 40 comments

6 participants

@XhmikosR

C:\Users\xmr\Desktop\bootstrap-blog>ruby -v && jekyll -v
ruby 1.9.3p545 (2014-02-24) [i386-mingw32]
jekyll 2.0.2

C:\Users\xmr\Desktop\bootstrap-blog>jekyll serve -w
Configuration file: C:/Users/xmr/Desktop/bootstrap-blog/_config.yml
            Source: C:/Users/xmr/Desktop/bootstrap-blog
       Destination: C:/Users/xmr/Desktop/bootstrap-blog/_site
      Generating...
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/posix-spawn-0.3.8/lib/posix/spawn.rb:162: warning: cannot close fd before spawn
'which' is not recognized as an internal or external command, operable program or batch file.
                    done.
 Auto-regeneration: enabled

C:\Users\xmr\Desktop\bootstrap-blog>

wdm is installed, 1.5.1 works fine.

@parkr
Owner

That looks like a problem with posix-spawn relying on the unix command which. We upgraded to Listen 2.x so it could also be on their end.

@XhmikosR

No, it's not an issue with posix-spawn since that warning always shows when highlighting is enabled on Windows, even with 1.5.1. Something else caused this regression...

@parkr
Owner

If you set highlighter: rouge in your _config.yml, does it fix itself?

Idea: tmm1/pygments.rb#110

@kleinfreund

I don't have posix-spawn and get the same error. Ruby version is ruby 1.9.3p545.

@XhmikosR
@parkr
Owner

That's a regression in 2.x...

Right, trying to pin-point the cause. I have no Windows computer to use so I need your help. Did any of the RC's or Alphas work for you?

@kleinfreund

Sorry, didn't use either Release Candidate's or Alpha's. Had 1.5.1 before and it worked (also on 1.4.x).

Say if there is something else we could test on our side.

@parkr
Owner

Please try the release candidate:

$ gem uninstall jekyll
$ gem install jekyll -v 2.0.0.rc1

and tell me if that works!

@XhmikosR
@parkr
Owner

Thank yoU!

@kleinfreund

Installing 2.0.0.rc1 and removing any previous version of Jekyll enables me to start a server with jekyll serve -w.

@parkr
Owner

Ok so it happened between 2.0.0.rc1 and 2.0.0. Thanks! v2.0.0.rc1...v2.0.0

@XhmikosR

Nope, v2.0.0.rc1 still fails here...

@XhmikosR

v2.0.0.alpha.1 works.
v2.0.0.alpha.2 and newer doesn't work.

v2.0.0.alpha.1...v2.0.0.alpha.2

@parkr
Owner

Perhaps 77f26d5 ?

@XhmikosR

Not sure how to test that. But it might as well be one of those refactoring patches.

@parkr
Owner

It upgraded the listen gem from ~> 1.3 to ~> 2.5, which I think caused the issue. Can you take a look at the listen gem's breaking changes to see if there are any weird Windows bugs introduced between 1.x and 2.x?

@XhmikosR

I see some changes but all this is theoretical.

https://github.com/guard/listen/releases

I uninstalled my listen gem, and did gem install listen -v "=1.3.1" but I'm not sure where is the local file I need to modify so that it doesn't require listen 2.5.

@XhmikosR

OK, I found it, it's C:\RailsInstaller\Ruby1.9.3\lib\ruby\gems\1.9.1\specifications\jekyll-2.0.3.gemspec

C:\Users\xmr\Desktop\bootstrap-blog>jekyll serve --watch
Configuration file: C:/Users/xmr/Desktop/bootstrap-blog/_config.yml
            Source: C:/Users/xmr/Desktop/bootstrap-blog
       Destination: C:/Users/xmr/Desktop/bootstrap-blog/_site
      Generating...
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/posix-spawn-0.3.8/lib/posix
/spawn.rb:162: warning: cannot close fd before spawn
'which' is not recognized as an internal or external command,operable program or batch file.
                    done.
jekyll 2.0.3 | Error:  undefined method `start' for #<Thread:0x22b5fa0 run>
@mscharley

Almost tempted to try to convince @parkr to switch back to listen 1.x... is there some benefit we need in 2.x?

@XhmikosR

But are we 100% that would fix this issue? Personally I haven't verified that yet.

@parkr
Owner

@XhmikosR Can you run that with --trace? On which line is that happening?

@XhmikosR
C:\Users\xmr\Desktop\bootstrap-blog>jekyll serve --watch --trace
Configuration file: C:/Users/xmr/Desktop/bootstrap-blog/_config.yml
            Source: C:/Users/xmr/Desktop/bootstrap-blog
       Destination: C:/Users/xmr/Desktop/bootstrap-blog/_site
      Generating...
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/posix-spawn-0.3.8/lib/posix/spawn.rb:162: warning: cannot close fd before spawn
'which' is not recognized as an internal or external command,operable program or batch file.
                    done.
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/jekyll-2.0.3/lib/jekyll/commands/build.rb:87:in `watch': undefined method `start' for #<Thread:0x231b8e0 dead> (NoMethodError)
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/jekyll-2.0.3/lib/jekyll/commands/build.rb:31:in `process'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/jekyll-2.0.3/lib/jekyll/commands/serve.rb:23:in `block (2 levels) in init_with_program'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/mercenary-0.3.3/lib/mercenary/command.rb:220:in `call'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/mercenary-0.3.3/lib/mercenary/command.rb:220:in `block in execute'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/mercenary-0.3.3/lib/mercenary/command.rb:220:in `each'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/mercenary-0.3.3/lib/mercenary/command.rb:220:in `execute'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/mercenary-0.3.3/lib/mercenary/program.rb:35:in `go'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/mercenary-0.3.3/lib/mercenary.rb:22:in `program'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/jekyll-2.0.3/bin/jekyll:18:in `<top (required)>'
        from C:/RailsInstaller/Ruby1.9.3/bin/jekyll:23:in `load'
        from C:/RailsInstaller/Ruby1.9.3/bin/jekyll:23:in `<main>'
@XhmikosR

OK, I made some progress.

Reverting to listen 1.3.1 and reverting this change (not the same line for 2.0.3 though) I get --watch to work again.

C:\Users\xmr\Desktop\bootstrap-blog>jekyll serve --watch
Configuration file: C:/Users/xmr/Desktop/bootstrap-blog/_config.yml
            Source: C:/Users/xmr/Desktop/bootstrap-blog
       Destination: C:/Users/xmr/Desktop/bootstrap-blog/_site
      Generating...
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/posix-spawn-0.3.8/lib/posix/spawn.rb:162: warning: cannot close fd before spawn
'which' is not recognized as an internal or external command,operable program or batch file.
                    done.
 Auto-regeneration: enabled
Configuration file: C:/Users/xmr/Desktop/bootstrap-blog/_config.yml
    Server address: http://0.0.0.0:4000/
  Server running... press ctrl-c to stop.
      Regenerating: 1 files at 2014-05-09 11:57:09 ...done.

BTW, I still find the done newline weird. For regenerating, it's added to the same line so now it's not only ugly but inconsistent too...

@XhmikosR

Also, this issue might be a dupe of #2196. But this one has more info IMO.

@XhmikosR

Also, it appears that with #2320 (comment) we get the log stuff twice, so I guess some further changes are needed.

@parkr
Owner

Also, it appears that with #2320 (comment) we get the log stuff twice, so I guess some further changes are needed.

It's because the configuration file is built twice – once for the initial build, then again for the serve command.

BTW, I still find the done newline weird

I don't like that we write lines without a newline at the end in general. I'd rather see this output changed to something else entirely, just not sure what yet. For now, we'll just have to deal with the newline.

@mscharley
@kleinfreund

(I posted this a few seconds ago already, but it appeared twice. I deleted one of the comments and then there was no comment. This is why I posted again.)

jekyll serve -w works for me now.

  • uninstalled RailsInstaller (Ruby v1.9.3)
  • installed Ruby (v2.0.0) with the help of this guide

Although I get this when using -w now:

  Please add the following to your Gemfile to avoid polling for changes:
    require 'rbconfig'
    gem 'wdm', '>= 0.1.0' if RbConfig::CONFIG['target_os'] =~ /mswin|mingw|cygwin/i
[Listen warning]:

 Auto-regeneration: enabled

edit: Right, I thought wdm was installed, but it wasn't. Sorry. Works on my end now.

@XhmikosR

I still wait for @emachnic to upload the Ruby binaries on S3 and then the Railsinstaller 3.0.0.0 should be ready for release. Regardless, I don't plan to go though any of this at this point. 1.5.1 works fine with 1.9.3, I'd expect 2.0.x to work with 1.9.3 too.

@parkr
Owner

I'd expect 2.0.x to work with 1.9.3 too.

We support 1.9.3 still, and so does guard/listen:

Tested on MRI Ruby environments (1.9+ only) via Travis CI).

Glad you got everything figured out, @kleinfreund!

@lyfshadyboss

perhaps the same issue, jekyll server -w terminated on my pc.

jekyll version is v2.0.3 and ruby 2.1.1.

the trace :

/home/liuyifeng/.rvm/gems/ruby-2.1.1/gems/celluloid-0.16.0.pre/lib/celluloid/tasks/task_fiber.rb:34:in `terminate': task was
terminated (Celluloid::Task::TerminatedError)
        from /home/liuyifeng/.rvm/gems/ruby-2.1.1/gems/celluloid-0.16.0.pre/lib/celluloid/actor.rb:350:in `each'
        from /home/liuyifeng/.rvm/gems/ruby-2.1.1/gems/celluloid-0.16.0.pre/lib/celluloid/actor.rb:350:in `cleanup'
        from /home/liuyifeng/.rvm/gems/ruby-2.1.1/gems/celluloid-0.16.0.pre/lib/celluloid/actor.rb:334:in `shutdown'
        from /home/liuyifeng/.rvm/gems/ruby-2.1.1/gems/celluloid-0.16.0.pre/lib/celluloid/actor.rb:326:in `handle_crash'
        from /home/liuyifeng/.rvm/gems/ruby-2.1.1/gems/celluloid-0.16.0.pre/lib/celluloid/actor.rb:161:in `rescue in run'
        from /home/liuyifeng/.rvm/gems/ruby-2.1.1/gems/celluloid-0.16.0.pre/lib/celluloid/actor.rb:147:in `run'
        from /home/liuyifeng/.rvm/gems/ruby-2.1.1/gems/celluloid-0.16.0.pre/lib/celluloid/actor.rb:129:in `block in start'
        from /home/liuyifeng/.rvm/gems/ruby-2.1.1/gems/celluloid-0.16.0.pre/lib/celluloid/thread_handle.rb:13:in `block in initialize'
        from /home/liuyifeng/.rvm/gems/ruby-2.1.1/gems/celluloid-0.16.0.pre/lib/celluloid/actor_system.rb:32:in `block in get_thread'
        from /home/liuyifeng/.rvm/gems/ruby-2.1.1/gems/celluloid-0.16.0.pre/lib/celluloid/internal_pool.rb:99:in `call'
        from /home/liuyifeng/.rvm/gems/ruby-2.1.1/gems/celluloid-0.16.0.pre/lib/celluloid/internal_pool.rb:99:in `block in create'
        from (celluloid):0:in `remote procedure call'
        from /home/liuyifeng/.rvm/gems/ruby-2.1.1/gems/celluloid-0.16.0.pre/lib/celluloid/calls.rb:92:in `value'
        from /home/liuyifeng/.rvm/gems/ruby-2.1.1/gems/celluloid-0.16.0.pre/lib/celluloid/proxies/sync_proxy.rb:33:in `method_missing'
        from /home/liuyifeng/.rvm/gems/ruby-2.1.1/gems/listen-2.7.5/lib/listen/listener.rb:144:in `_init_actors'
        from /home/liuyifeng/.rvm/gems/ruby-2.1.1/gems/listen-2.7.5/lib/listen/listener.rb:37:in `start'
        from /home/liuyifeng/.rvm/gems/ruby-2.1.1/gems/jekyll-2.0.3/lib/jekyll/commands/build.rb:87:in `watch'
        from /home/liuyifeng/.rvm/gems/ruby-2.1.1/gems/jekyll-2.0.3/lib/jekyll/commands/build.rb:31:in `process'
        from /home/liuyifeng/.rvm/gems/ruby-2.1.1/gems/jekyll-2.0.3/lib/jekyll/commands/serve.rb:23:in `block (2 levels) in init_with_program'
        from /home/liuyifeng/.rvm/gems/ruby-2.1.1/gems/mercenary-0.3.3/lib/mercenary/command.rb:220:in `call'
        from /home/liuyifeng/.rvm/gems/ruby-2.1.1/gems/mercenary-0.3.3/lib/mercenary/command.rb:220:in `block in execute'
        from /home/liuyifeng/.rvm/gems/ruby-2.1.1/gems/mercenary-0.3.3/lib/mercenary/command.rb:220:in `each'
        from /home/liuyifeng/.rvm/gems/ruby-2.1.1/gems/mercenary-0.3.3/lib/mercenary/command.rb:220:in `execute'
        from /home/liuyifeng/.rvm/gems/ruby-2.1.1/gems/mercenary-0.3.3/lib/mercenary/program.rb:35:in `go'
        from /home/liuyifeng/.rvm/gems/ruby-2.1.1/gems/mercenary-0.3.3/lib/mercenary.rb:22:in `program'
        from /home/liuyifeng/.rvm/gems/ruby-2.1.1/gems/jekyll-2.0.3/bin/jekyll:18:in `<top (required)>'
        from /home/liuyifeng/.rvm/gems/ruby-2.1.1/bin/jekyll:23:in `load'
        from /home/liuyifeng/.rvm/gems/ruby-2.1.1/bin/jekyll:23:in `<main>'
        from /home/liuyifeng/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `eval'
        from /home/liuyifeng/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `<main>'
@XhmikosR

I think this was fixed in listen 2.7.6. Can someone else confirm?

C:\Users\xmr\Desktop\bootstrap>ruby -v && jekyll -v
ruby 1.9.3p545 (2014-02-24) [i386-mingw32]
jekyll 2.0.3

C:\Users\xmr\Desktop\bootstrap>jekyll serve -w
Configuration file: C:/Users/xmr/Desktop/bootstrap/_config.yml
            Source: docs
       Destination: _gh_pages
      Generating...
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/posix-spawn-0.3.8/lib/posix/spawn.rb:162: warning: cannot close fd before spawn
'which' is not recognized as an internal or external command, operable program or batch file.
                    done.
 Auto-regeneration: enabled
Configuration file: C:/Users/xmr/Desktop/bootstrap/_config.yml
    Server address: http://0.0.0.0:9001//
  Server running... press ctrl-c to stop.
      Regenerating: 1 files at 2014-06-02 09:53:01 ...done.

Also @parkr if this is correct, how about requiring 2.7.6 or newer?

@parkr
Owner

Happy to force-upgrade to 2.7.6 or higher in Jekyll 2.1.

@XhmikosR

It seems to work fine on my VM. I removed listen 2.7.6 and installed 2.7.5; that fails again. So, I think it's fair to assume the issue was listen after all. When do you plan to release 2.1 approximately?

@XhmikosR XhmikosR referenced this issue from a commit
@XhmikosR XhmikosR Force upgrade listen to v2.7.6.
This fixes #2320.
6aacc24
@XhmikosR XhmikosR closed this
@e2 e2 referenced this issue in guard/listen
Open

Problems on Windows #149

@Oberon00

This issue is there again in the newest listen version (2.8.5). I have bisected the versions (by changing it in my Gemfile.lock): 2.7.9 works fine, 2.7.10 seems nonexistent, and since 2.7.11 it silently exits.

@parkr
Owner

@Oberon00 Please file on the guard/listen repo.

@XhmikosR
@Oberon00

Oh, yes I'm running jerkyll with Ruby 1.9.3p551. Then that will probably be the issue.

I don't have enough information to post at guard/listen, since jekyll just silently exits. Also I don't know Ruby (I'm using it just for jekyll) and don't want to put too much time into debugging this since I have found a workaround now.

@XhmikosR

I never managed to pinpoint this issue down to any gems; only using Ruby 2.x fixed the issue for me...

Unfortunately, there are more issues with Ruby 2.x. One is the yajl-ruby issue you will hit if you use pygments.rb. The other one is a rubygems issue when installing Jekyll which can be worked around by using rubygems 2.3.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.