Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jekyll/Ruby Kramdown Missing Dependency

I am struggling with trying to set up my first jekyll blog. I am trying to run jekyll server, but upon typing it into the terminal I get the error message:

You are missing a library required for Markdown. Please run:
$ [sudo] gem install kramdown
Conversion error: Jekyll::Converters::Markdown encountered an error while converting '_posts/2013-08-15-immunize-canada-app.md/#excerpt':
                Missing dependency: kramdown
         ERROR: YOUR SITE COULD NOT BE BUILT:
                ------------------------------------
                Missing dependency: kramdown

I have already installed kramdown as it asks, but still receive this error. I found on another post to add gem 'kramdown' to the Gemfile, which still doesn't work. I am super new to Ruby/Jekyll, so any help would be very appreciated!

like image 203
abalabazn Avatar asked Jul 14 '15 21:07

abalabazn


2 Answers

I think the problem is

gem query | grep kramdown
kramdown (1.8.0, 1.5.0)

bundle show kramdown
/Library/Ruby/Gems/2.0.0/gems/kramdown-1.5.0

as suggested in http://bundler.io/, always use bundle exec

bundle exec jekyll serve --watch 

In some cases, running executables without bundle exec may work, if the executable happens to be installed in your system and does not pull in any gems that conflict with your bundle. However, this is unreliable and is the source of considerable pain. Even if it looks like it works, it may not work in the future or on another machine.

like image 200
Dyno Fu Avatar answered Oct 25 '22 16:10

Dyno Fu


This is most likely due to multiple installed jekyll gems. Jekyll can be installed multiple times because one may have

  1. installed it by gem install jekyll on first try
  2. added github-pages dependency in Gemfile as suggested by the guides

Therefore you should check if there are multiple installed copies. Run gem list jekyll from the shell, which outputs the following:

$ gem list jekyll

*** LOCAL GEMS ***

jekyll (2.5.3, 2.4.0)
jekyll-coffeescript (1.0.1)
jekyll-feed (0.3.1)
jekyll-gist (1.3.4, 1.2.1)
...

As you see, 2.5.3 and 2.4.0 are installed. I am running gem uninstallto get rid of one. The old version is a dependency of github-pages, therefore just uninstall jekyll-2.5.3.

$ gem uninstall jekyll

Select gem to uninstall:
 1. jekyll-2.4.0
 2. jekyll-2.5.3
 3. All versions
> 2
Successfully uninstalled jekyll-2.5.3

I have also uninstalled jekyll-gist the same way. This way you don't need to uninstall ruby at all.

like image 12
mcku Avatar answered Oct 25 '22 17:10

mcku