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 activatejekyll-markdown-block-1.1.0
, becausejekyll-3.1.1
conflicts withjekyll (~> 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?
答案 0 :(得分:12)
从2.x更新到jekylls 3.1.2后,我遇到了同样的问题。
运行jekyll serve
,我收到以下消息:
依赖性错误:哎呀!看起来你没有安装kramdown或其中一个依赖项。目前使用Jekyll 配置好后,你需要安装这个gem。完整的错误消息 来自Ruby的是:'无法加载这样的文件 - kramdown'如果你碰到了 麻烦,您可以在http://jekyllrb.com/help/找到有用的资源!
我做了Virtua Creative对他评论的建议:
bundle install
然后:
bundle exec jekyll serve
初始命令给了我同样的错误,但bundle exec有效。
答案 1 :(得分:6)
似乎捆绑的环境很混乱。如果您有权限问题,请尝试bundle clean --force
- 使用sudo。
答案 2 :(得分:5)
确保已安装捆绑包
sudo gem install bundler