5

I tried updating Jekyll and am now running into an issue. Luckily I can still build my sites by using bundle exec jekyll serve, but when I run jekyll serve I get the following:

Traceback (most recent call last):
        10: from /Users/jon.graft/.rbenv/versions/2.6.3/bin/jekyll:23:in `<main>'
         9: from /Users/jon.graft/.rbenv/versions/2.6.3/bin/jekyll:23:in `load'
         8: from /Users/jon.graft/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/jekyll-4.0.0/exe/jekyll:11:in `<top (required)>'
         7: from /Users/jon.graft/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/jekyll-4.0.0/lib/jekyll/plugin_manager.rb:52:in `require_from_bundler'
         6: from /Users/jon.graft/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/bundler-2.0.2/lib/bundler.rb:107:in `setup'
         5: from /Users/jon.graft/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/bundler-2.0.2/lib/bundler/runtime.rb:26:in `setup'
         4: from /Users/jon.graft/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/bundler-2.0.2/lib/bundler/runtime.rb:26:in `map'
         3: from /Users/jon.graft/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/bundler-2.0.2/lib/bundler/spec_set.rb:148:in `each'
         2: from /Users/jon.graft/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/bundler-2.0.2/lib/bundler/spec_set.rb:148:in `each'
         1: from /Users/jon.graft/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/bundler-2.0.2/lib/bundler/runtime.rb:31:in `block in setup'
/Users/jon.graft/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/bundler-2.0.2/lib/bundler/runtime.rb:319:in `check_for_activated_spec!': You have already activated i18n 1.6.0, but your Gemfile requires i18n 0.9.5. Prepending `bundle exec` to your command may solve this. (Gem::LoadError)

What is wrong and how do I fix this? I am working more and more with Jekyll so I would like to understand why this is happening so I can fix / avoid it if it happens again.

1 Answer 1

5

Your Gemfile requires version 0.95 of the package i18n But you have already installed version 1.6.0. This is why you need to prepend the commands with bundle exec, so bundle can do its job and forward the correct version of the package to Jekyll. This is normal and nothing to worry about. I suggest to write a script to make Jekyll serve or build, so you don't have to type this much. For example, my serve.sh, it even uses a different config for the local serve:

bundler exec jekyll serve --config config.dev.yml --host 10.10.10.1 --incremental

Alternatively, you can edit your Gemfile.lock and try to change the version of i18n to 1.6.0. I have just tried that and it worked fine, however the post install message may be of relevance:


HEADS UP! i18n 1.1 changed fallbacks to exclude default locale.
But that may break your application.

Please check your Rails app for 'config.i18n.fallbacks = true'.
If you're using I18n (>= 1.1.0) and Rails (< 5.2.2), this should be
'config.i18n.fallbacks = [I18n.default_locale]'.
If not, fallbacks will be broken in your app by I18n 1.1.x.

So, if you are using Jekyll to do a multi-language web, make sure to keep that in mind if errors or unusual bugs occur.

2
  • So if I understand correctly, when I run bundle exec jekyll serve Ruby checks inside Gemfile.lock and builds the site using an older version of Jekyll & some plugins. Am I missing out on any features or enhancements by running an older version? What is defining that my site needs these specific version numbers? I would think if I delete the Gemfile.lock and re-ran bundle that it would create a new Gemfile.lock with the latest versions.
    – Jonathan
    Sep 18, 2019 at 23:17
  • @Jonathan The version of your main package defines your dependencies. Just like a Windows program needs the MSVC2015 or 2018 redist DLL. So, if you upgrade Jekyll and want to use the new Version, edit your Gemfile (not Gemfile.lock in this case), increase the Jekyll Version and delete Gemfile.lock. Then run bundle install and a new Gemfile.lock is created with new dependencies. Sep 19, 2019 at 3:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .