9

Following the official update guide, I recently upgraded from Jekyll 2.x to Jekyll 3.1.1.

After the installation, running jekyll serve produced the following error:

Dependency Error: Yikes! It looks like you don't have jekyll-markdown-block 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: 'Unable to activate jekyll-markdown-block-1.1.0, because jekyll-3.1.1 conflicts with jekyll (~> 2.0)' If you run into trouble, you can find helpful resources at http://jekyllrb.com/help/!

So from there I sudo gem update jekyll-markdown-block, but the error still persisted. I then tried to update all of my gems:

sudo gem update `gem list | cut -d ' ' -f 1`

And then out of desperation, uninstalled all of my gems (except the core one, which I was not permitted to uninstall):

sudo gem uninstall `gem list | cut -d ' ' -f 1`

I then proceeded to install jekyll like normal (assuming I was now working from a clean slate):

sudo gem install jekyll
Fetching: liquid-3.0.6.gem (100%)
Successfully installed liquid-3.0.6
Fetching: kramdown-1.9.0.gem (100%)
Successfully installed kramdown-1.9.0
....
Parsing documentation for jekyll-watch-1.3.1
Installing ri documentation for jekyll-watch-1.3.1
Parsing documentation for jekyll-3.1.1
Installing ri documentation for jekyll-3.1.1
14 gems installed

After then installing jekyll-press and jekyll-markdown-block (a new error message complained I didn't have them), I then received the original error message complaining about Jekyll 2.x.

How can I fully remove Jekyll 2.x and complete the upgrade without gem dependency errors?

James Taylor
  • 5,468
  • 6
  • 42
  • 62
  • Have you tried adding `jekyll-markdown-block` to the Gemfile of your jekyll site? – AntK Feb 03 '16 at 12:37
  • 1
    Try build the site with `bundler`. If you don't have it installed run `gem install bundler` from your command line. Then, add a Gemfile with all gems you need. Then, exec `bundle install`, when bundler will install all required gems and their dependencies. And finally, run `bundle exec jekyll serve` to serving locally. You can add the flags `--watch` , `--baseurl "" ` and also `--safe` to the `bundle exec` command. – Virtua Creative Feb 03 '16 at 15:31
  • Update: I ultimately got this to work by going to a new directory and running `jekyll init`. Serving this newly created site worked and I just ported over the old site. I'm pretty sure there were configuration changes that caused the old site to break. – James Taylor Mar 21 '16 at 01:09

3 Answers3

12

I was having the same problem after updating to jekylls 3.1.2 from 2.x. Running jekyll serve, I received the following message:

Dependency Error: Yikes! It looks like you don't have kramdown 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 -- kramdown' If you run into trouble, you can find helpful resources at http://jekyllrb.com/help/!

I did what Virtua Creative suggest on his comment:

bundle install

and then:

bundle exec jekyll serve

The initial command was giving me the same error, but the bundle exec works.

Darien
  • 414
  • 2
  • 15
  • 1
    huh, I'm dealing with your same `kramdown` issue, and your solution works, but why? – Josh.F Mar 14 '16 at 23:23
  • I had the same experience. My guess is that `bundle exec jekyll serve` uses the dependencies installed locally by `bundle install`, where as `jekyll serve` uses globally installed gems. I bet if we try `gem install kramdown` or something, it would fix it. – Tobias Fünke Apr 01 '16 at 13:32
  • I ran into this too. The issue seems to be caused by bundler. Ran `jekyll serve --trace` and found the exception was throwing in bundler. When I uninstall bundler, I was able to build the site with jekyll 3.1.2. – codewise Apr 06 '16 at 20:03
6

Seems that the bundle envitorment is confused. Try bundle clean --force - with sudo, if you have permission issues.

Carlo
  • 1,961
  • 19
  • 28
5

Make sure that you have installed the bundler,

sudo gem install bundler
Lean Junio
  • 66
  • 1
  • 3