1

While trying to run the jekyll serve in GitBash(Win10),I got the following error:

$ jekyll server
Configuration file: D:/Blog/mysite/_config.yml
            Source: D:/Blog/mysite
       Destination: D:/Blog/mysite/_site
 Incremental build: disabled. Enable with --incremental
      Generating...
                    done in 3.25 seconds.
  Dependency Error: Yikes! It looks like you don't have jekyll-watch or one of its dependencies installed. In order to use Jekyll as currently configured, you'll need to install this gem. The full error message from Ruby is: 'cannot load such file -- ruby_dep/warning' If you run into trouble, you can find helpful resources at https://jekyllrb.com/help/!
jekyll 3.7.3 | Error:  jekyll-watch·

I was trying to solve the error via these ways:jekyll serve shows a dependency error,but it didn't work.

  1. according to the prompt, I installed the jekyll-watch again, and then I ran jekyll serve again, the same error was coming up again. In other words, it didn't work for me.

    $ jekyll server
    Configuration file: D:/Blog/mysite/_config.yml
                Source: D:/Blog/mysite
           Destination: D:/Blog/mysite/_site
     Incremental build: disabled. Enable with --incremental
        Generating...
                      done in 3.25 seconds.
    Dependency Error: Yikes! It looks like you don't have jekyll-watch or one of its dependencies installed. In order to use Jekyll as currently configured, you'll need to install this gem. The full error message from Ruby is: 'cannot load such file -- ruby_dep/warning' If you run into trouble, you can find helpful resources at https://jekyllrb.com/help/!
    jekyll 3.7.3 | Error:  jekyll-watch
    
  2. I tried to bundle install,and then ran $ bundle exec jekyll serve,the another error was coming...

    $ bundle exec jekyll serve
    D:/rubyInstall/Ruby25-x64/lib/ruby/gems/2.5.0/gems/jekyll-3.7.3/lib/jekyll.rb:35:in 'require': cannot load such file -- i18n (LoadError)
            from D:/rubyInstall/Ruby25-x64/lib/ruby/gems/2.5.0/gems/jekyll-3.7.3/lib/jekyll.rb:35:in '<top (required)>'
            from D:/rubyInstall/Ruby25-x64/lib/ruby/gems/2.5.0/gems/jekyll-3.7.3/exe/jekyll:8:in 'require'
            from D:/rubyInstall/Ruby25-x64/lib/ruby/gems/2.5.0/gems/jekyll-3.7.3/exe/jekyll:8:in '<top (required)>'
            from D:/rubyInstall/Ruby25-x64/bin/jekyll:23:in 'load'
            from D:/rubyInstall/Ruby25-x64/bin/jekyll:23:in '<main>'
    
ashmaroli
  • 5,209
  • 2
  • 14
  • 25
honeysyt
  • 13
  • 6
  • Please post the output generated when you run `bundle show` – ashmaroli Apr 07 '18 at 08:10
  • `Gems included by the bundle: * addressable (2.5.2) * bundler (1.16.1) * colorator (1.1.0) * ffi (1.9.23) * forwardable-extended (2.6.0) * jekyll (3.7.3) * jekyll-paginate (1.1.0) * jekyll-sass-converter (1.5.2) * jekyll-sitemap (1.2.0) * jekyll-watch (2.0.0) * kramdown (1.16.2) * liquid (4.0.0) * listen (3.1.5) * mercenary (0.3.6) * pathutil (0.16.1) * public_suffix (3.0.2) * rb-fsevent (0.10.3) * rb-inotify (0.9.10) * redcarpet (3.4.0) * rouge (3.1.1) * safe_yaml (1.0.4) * sass (3.5.6) * sass-listen (4.0.0)` – honeysyt Apr 07 '18 at 14:38
  • I'm very sorry about the format of the answer.I just got in touch with it,and I'm not familiar with this grammar.So...it's not yet inserted into the picture.please forgive me... – honeysyt Apr 07 '18 at 14:47
  • 1
    Never mind the format. From above I can see that `bundle install` did not complete successfully. Delete the **`Gemfile.lock`** and run `bundle install` once again.. – ashmaroli Apr 07 '18 at 15:00
  • Oh...the same error happened again! Could you tell me while gems were missed ? Maybe I can install them directly. – honeysyt Apr 07 '18 at 15:12
  • What error did you encounter while running `bundle install`? – ashmaroli Apr 07 '18 at 15:14
  • Accoring your way,the `Gemfile.lock` file had been found in path :`D:\rubyInstall\Ruby25-x64\lib\ruby\gems\2.5.0\gems\http_parser.rb-0.6.0`,and deleted it.Then I ran `bundle install`,the same gems were installed.While I was running the `jekyll serve`,above error happend... – honeysyt Apr 08 '18 at 03:05
  • ![click the link](https://github.com/syt-honey/study_picture/blob/master/test.jpg) – honeysyt Apr 08 '18 at 04:01
  • sent a PR to one of your repo.. – ashmaroli Apr 08 '18 at 04:24
  • Wow!! It's working !! – honeysyt Apr 08 '18 at 06:17
  • ! [bundle exec picture link](https://github.com/syt-honey/study_picture/blob/master/bundleExec.png),.Hey~,thanks so much.It's finally settled! – honeysyt Apr 08 '18 at 06:20
  • You're welcome! :) Happy to know that you've finally resolved this issue.. – ashmaroli Apr 08 '18 at 08:16

2 Answers2

4

Remove the Gemfile.lock file and run bundle install once again.

This is what @ashmaroli was suggesting in the comments and it worked.

vvvvv
  • 25,404
  • 19
  • 49
  • 81
1

The reason I asked you to post the output from bundle show is to assess if all the dependencies have been installed successfully.

If you go through the first error output, you'll see the following:

The full error message from Ruby is: 'cannot load such file -- ruby_dep/warning'

This means that the gem ruby_dep did not install properly. (ruby_dep is a second-order dependency of jekyll-watch)

So, the question here is,

    "Where you able to finish bundle install completely without any errors?"

If no, you probably need to install the Ruby Devkit for your Ruby version by running the following:

$ ridk install
ashmaroli
  • 5,209
  • 2
  • 14
  • 25
  • Thanks for your answer,I'm a beginner. I remember that the ruby I installed was with Devkit,the link(the first in the directory) :https://rubyinstaller.org/downloads/. – honeysyt Apr 07 '18 at 10:29
  • And the strangest thing is the `ruby_dep` was installed in my gems directory. – honeysyt Apr 07 '18 at 10:36
  • I have another problem ,how can I know how many dependencies the gem has ?(like you said ,`ruby_dep` is a second-order dependency of `jekyll-watch`),Where do I find it ? – honeysyt Apr 07 '18 at 10:42
  • 1
    The easiest way is to read through your `Gemfile.lock`. `jekyll-watch` depends on `listen` which in turn depends on `ruby_dep` – ashmaroli Apr 07 '18 at 10:47
  • You say you have `ruby_dep` installed in your gems directory. If so, does it have a file at path `lib/ruby_dep/warning.rb`? – ashmaroli Apr 07 '18 at 10:52
  • yup! There's this file. – honeysyt Apr 07 '18 at 14:03
  • okay please update your "question" with the output from running `bundle show` – ashmaroli Apr 07 '18 at 14:23