0

I recently installed Windows Subsystem for Linux and I'm running the Ubuntu distro on my Windows 10 computer. I installed Python, pip, Ruby, and Jekyll and they are all confirmed to be installed properly when I run the --version flags.

I am trying to run and modify a Jekyll theme called Mediumish locally on my computer. When following the author's instructions (i.e. run bundle and run jekyll serve --watch), I encounter the following errors:

Traceback (most recent call last):
        5: from /usr/local/bin/jekyll:23:in `<main>'
        4: from /usr/local/bin/jekyll:23:in `load'
        3: from /var/lib/gems/2.5.0/gems/jekyll-3.8.6/exe/jekyll:11:in `<top (required)>'
        2: from /var/lib/gems/2.5.0/gems/jekyll-3.8.6/lib/jekyll/plugin_manager.rb:48:in `require_from_bundler'
        1: from /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
/usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require': cannot load such file -- bundler (LoadError)

I have tried submitting issues to the author's Github account, but it appears he has stopped replying (and maintaining) this theme for a few months.

I found another Stackoverflow post titled Ruby/Jekyll unknown error when running -watch — which is very similar to what I'm experiencing. I have tried the recommended solutions from this post which are to run the jekyll build --watch and jekyll serve --watch commands, but the same errors occur.

I was able to successfully run this theme a few months ago, but after reformatting my computer, reinstalling all my applications from scratch, and cloning a new copy of the theme from the author's website, I am unable to serve the website locally thus impeding me from viewing any modifications I make to the blog theme.

MuyGalan
  • 61
  • 1
  • 2
  • 10
  • Maybe you need to install `bundler`? One way to install is by running command `gem install bundler` – Kin Jul 31 '19 at 17:15
  • 1
    Can you try running `bundle exec jekyll serve --watch` instead? – Jay Dorsey Jul 31 '19 at 17:32
  • @Kin I ran `gem install bundler` as you suggested and received the following message: ```Successfully installed bundler-2.0.2 Parsing documentation for bundler-2.0.2 Done installing documentation for bundler after 4 seconds 1 gem installed```, but I am still receiving the same errors. – MuyGalan Jul 31 '19 at 19:51
  • @JayDorsey Running the `bundle exec jekyll serve --watch` command returns the following error: ```Traceback (most recent call last): 2: from /usr/local/bin/bundle:23:in `
    ' 1: from /usr/lib/ruby/2.5.0/rubygems.rb:308:in `activate_bin_path' /usr/lib/ruby/2.5.0/rubygems.rb:289:in `find_spec_for_exe': can't find gem bundler (>= 0.a) with executable bundle (Gem::GemNotFoundException)```
    – MuyGalan Jul 31 '19 at 19:54
  • I want to say this was a known issue. There's 2 things I can think of: 1) run `gem update --system` 2) double check your bundler version with `bundle --version` and make sure it's 2.0.2; it might be defaulting to an older version. I think the system update would fix it though, if it's what I think it is – Jay Dorsey Jul 31 '19 at 19:57
  • @JayDorsey I was able to confirm I am running bundler version 2.0.2. Running `gem update --system` almost fixed the issue, but I'm encountering a new error. (I may have to split the error in several comments:) ```Error: could not read file /mnt/c/Users/muyga/Desktop/mediumish-theme-jekyll/vendor/bundle/gems/jekyll-3.8.5/lib/site_template/_posts/0000-00-00-welcome-to-jekyll.markdown.erb: Invalid date '<%= Time.now.strftime('%Y-%m-%d %H:%M:%S %z') %>': Document 'vendor/bundle/gems/jekyll-3.8.5/lib/site_template/_posts/0000-00-00-welcome-to-jekyll.markdown.erb' does not have a valid date in ``` – MuyGalan Jul 31 '19 at 21:07
  • @JayDorsey Error cont'd: ```the YAML front matter. ERROR: YOUR SITE COULD NOT BE BUILT: ------------------------------------ Invalid date '<%= Time.now.strftime('%Y-%m-%d %H:%M:%S %z') %>': Document 'vendor/bundle/gems/jekyll-3.8.5/lib/site_template/_posts/0000-00-00-welcome-to-jekyll.markdown.erb' does not have a valid date in the YAML front matter.``` – MuyGalan Jul 31 '19 at 21:08

1 Answers1

1

I ran the gem update --system command and my Jekyll theme almost served locally.

I received the following error:

Error: could not read file /mnt/c/Users/muyga/Desktop/mediumish-theme-jekyll/vendor/bundle/gems/jekyll-3.8.5/lib/site_template/_posts/0000-00-00-welcome-to-jekyll.markdown.erb: Invalid date '<%= Time.now.strftime('%Y-%m-%d %H:%M:%S %z') %>': Document 'vendor/bundle/gems/jekyll-3.8.5/lib/site_template/_posts/0000-00-00-welcome-to-jekyll.markdown.erb' does not have a valid date in the YAML front matter. ERROR: YOUR SITE COULD NOT BE BUILT: ------------------------------------ Invalid date '<%= Time.now.strftime('%Y-%m-%d %H:%M:%S %z') %>': Document 'vendor/bundle/gems/jekyll-3.8.5/lib/site_template/_posts/0000-00-00-welcome-to-jekyll.markdown.erb' does not have a valid date in the YAML front matter.

In order to fix that error, I modified my config.yml file and added vendor to the exclude: category to exclude that folder within my theme folder.

Now when I run bundle exec jekyll serve --watch the theme serves properly.

Thanks to @JayDorsey and Jekyll: Error: Site could not be built, wrong date format for the solutions!

MuyGalan
  • 61
  • 1
  • 2
  • 10