Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using jekyll with --watch flag causing build errors

I am using Jekyll on Windows 8 to work on a small project for work. So far I am loving Jekyll, but have encountered an issue when trying to serve my site with the --watch flag, which allows the site to update on refresh when changes are made to the code.

When I run my Jekyll sites I will open my cmd and cd to the proper directory. Per the Jekyll docs, I will execute chcp 65001 in the directory to change the encoding to UTF-8. Now, when I run jekyll serve -w or jekyll serve --watch I get an error dump consisting of the following:

C:\Dropbox\Workbench\lunch-and-learn>jekyll serve -w
    Configuration file: C:/Dropbox/Workbench/lunch-and-learn/_config.yml
                Source: C:/Dropbox/Workbench/lunch-and-learn
           Destination: C:/Dropbox/Workbench/lunch-and-learn/_site
          Generating... done.
     Auto-regeneration: enabled
C:/RailsInstaller/Ruby1.9.3/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require': cannot load such file -- wdm (LoadError)
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/listen-1.3.1/lib/listen/adapter.rb:207:in `load_dependent_adapter'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/listen-1.3.1/lib/listen/adapters/windows.rb:33:in `load_dependent_adapter'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/listen-1.3.1/lib/listen/adapter.rb:198:in `usable?'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/listen-1.3.1/lib/listen/adapters/windows.rb:25:in `usable?'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/listen-1.3.1/lib/listen/adapter.rb:190:in `usable_and_works?'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/listen-1.3.1/lib/listen/adapter.rb:57:in `block in select_and_initialize'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/listen-1.3.1/lib/listen/adapter.rb:55:in `each'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/listen-1.3.1/lib/listen/adapter.rb:55:in `select_and_initialize'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/listen-1.3.1/lib/listen/listener.rb:291:in `initialize_adapter'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/listen-1.3.1/lib/listen/listener.rb:283:in `setup'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/listen-1.3.1/lib/listen/listener.rb:52:in `start'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/jekyll-1.4.1/lib/jekyll/commands/build.rb:56:in `watch'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/jekyll-1.4.1/lib/jekyll/commands/build.rb:8:in `process'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/jekyll-1.4.1/bin/jekyll:97:in `block (2 levels) in <top (required)>'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/commander-4.1.5/lib/commander/command.rb:180:in `call'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/commander-4.1.5/lib/commander/command.rb:180:in `call'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/commander-4.1.5/lib/commander/command.rb:155:in `run'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/commander-4.1.5/lib/commander/runner.rb:402:in `run_active_command'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/commander-4.1.5/lib/commander/runner.rb:66:in `run!'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/commander-4.1.5/lib/commander/delegates.rb:11:in `run!'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/commander-4.1.5/lib/commander/import.rb:10:in `block in <top (required)>'

It is worth noting that when I run the site with simply jekyll serve, without the --watch or -w flags, the site builds and serves just fine to port 4000. However this is not ideal for development.

Link to Jekyll Usage

like image 272
robabby Avatar asked Dec 11 '13 16:12

robabby


People also ask

What is Gemfile in jekyll?

A Gemfile is a list of gems used by your site. Every Jekyll site has a Gemfile in the main folder. For a simple Jekyll site it might look something like this: source "https://rubygems.org" gem "jekyll" group :jekyll_plugins do gem "jekyll-feed" gem "jekyll-seo-tag" end.

What port does jekyll use?

Local server port The default is `4000`.

What does jekyll build do?

Jekyll is a static site generator with built-in support for GitHub Pages and a simplified build process. Jekyll takes Markdown and HTML files and creates a complete static website based on your choice of layouts. Jekyll supports Markdown and Liquid, a templating language that loads dynamic content on your site.

What is _config Yml?

Jekyll's main configuration options are specified in a _config. yml file, which is written in a language called YAML and placed in your site's root directory. Parameters configured in _config. yml are global or site-wide - that means they are accessible in every page of your website.


1 Answers

As shown in the error message, wdm is not found.

First, update your gems

gem update

Then, manually install wdm

gem install wdm
like image 62
Yi Zeng Avatar answered Oct 23 '22 12:10

Yi Zeng