jekyll: jekyll install leads to immediate errors
Just starting out with Jekyll. Ruby is up to date. I ran
sudo gem install jekyll
and jekyll installs fine.
But when I run a test command, like, jekyll -v, I get this error:
WARN: Unresolved specs during Gem::Specification.reset:
listen (< 3.1, ~> 3.0)
WARN: Clearing out unresolved specs.
Please report a bug if this causes problems.
/usr/local/lib/ruby/gems/2.4.0/gems/bundler-1.15.2/lib/bundler/runtime.rb:317:in `check_for_activated_spec!': You have already activated kramdown 1.14.0, but your Gemfile requires kramdown 1.13.2. Prepending `bundle exec` to your command may solve this. (Gem::LoadError)
from /usr/local/lib/ruby/gems/2.4.0/gems/bundler-1.15.2/lib/bundler/runtime.rb:32:in `block in setup'
from /usr/local/Cellar/ruby/2.4.1_1/lib/ruby/2.4.0/forwardable.rb:229:in `each'
from /usr/local/Cellar/ruby/2.4.1_1/lib/ruby/2.4.0/forwardable.rb:229:in `each'
from /usr/local/lib/ruby/gems/2.4.0/gems/bundler-1.15.2/lib/bundler/runtime.rb:27:in `map'
from /usr/local/lib/ruby/gems/2.4.0/gems/bundler-1.15.2/lib/bundler/runtime.rb:27:in `setup'
from /usr/local/lib/ruby/gems/2.4.0/gems/bundler-1.15.2/lib/bundler.rb:101:in `setup'
from /usr/local/lib/ruby/gems/2.4.0/gems/jekyll-3.5.1/lib/jekyll/plugin_manager.rb:48:in `require_from_bundler'
from /usr/local/lib/ruby/gems/2.4.0/gems/jekyll-3.5.1/exe/jekyll:9:in `<top (required)>'
from /usr/local/bin/jekyll:22:in `load'
from /usr/local/bin/jekyll:22:in `<main>'
What gives?
Edit: tried bundle exec, gem install bundler, nothing works.
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 16 (11 by maintainers)
Something that’s not clearly stated in our docs:
Running Jekyll commands with recent versions, is highly dependent on the presence of a
Gemfilein the location (directory) from which the commands are called…Gemfile, always prepend jekyll commands withbundle exec. i.e.bundle exec jekyll -vorbundle exec jekyll serve.Note: This requires Bundler gem to be installed as well.--traceto the command.bundle updatemay help with slightly older releases.@ashmaroli in Linux, if you’re not the root user and you’re using the system’s ruby (instead of using version managers like
rvm), and you try to rungem install jekyll bundlerwithoutsudo, you get this errorThis Stack Overflow question has more details.
@lrdegeest Looking at this part of the error message
It is telling you to add
bundle execin front of all your Jekyll commands. For example, usebundle exec jekyll serveinstead ofjekyll serve. I get the impression from your post that you seem to be runningbundle execalone by itself. I apologize in advance if I misunderstood your post.I experienced the exact same issue. Prepending 'bundle exec ’ to each jekyll command (such as
bundle exec jekyll serveindeed seems to work. Weird stuff. It’s voodoo, I guess.Don’t do this. It may lead to other bugs. The proper way is to just run
bundle updateDo https://jekyllrb.com/docs/troubleshooting/#installation-problems needs to be updated?
I’m no Linux user but @jekyll/documentation would certainly appreciate a contribution here.