Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jekyll / gem: Unresolved specs

Tags:

ruby

gem

jekyll

I am using Jekyll, I have two independent repositories, and I think I updated one recently. Everything was working fine last time I rendered my blog. Now just this:

$ jekyll serve --watch
WARN: Unresolved specs during Gem::Specification.reset:
      redcarpet (~> 3.1)
      jekyll-watch (~> 1.1)
      classifier-reborn (~> 2.0)
WARN: Clearing out unresolved specs.
Please report a bug if this causes problems.
/var/lib/gems/2.1.0/gems/jekyll-2.5.2/bin/jekyll:21:in `block in <top (required)>': cannot load such file -- jekyll/version (LoadError)
    from /var/lib/gems/2.1.0/gems/mercenary-0.3.5/lib/mercenary.rb:18:in `program'
    from /var/lib/gems/2.1.0/gems/jekyll-2.5.2/bin/jekyll:20:in `<top (required)>'
    from /usr/local/bin/jekyll:23:in `load'
    from /usr/local/bin/jekyll:23:in `<main>'

What the heck is going on? It seems Jekyll or Gem killed itself. How can I fix this?

How can I prevent that Jekyll or Ruby is messing around with the global install (I think that's what's happening-the two blogs are not independent of each other)? Can I ensure that each Jekyll directory is isolated from another, like in any descent programming language / build system?


Edit. I randomly ran sudo gem cleanup && bundle install. This seems to have uninstalled (!?!) all the gems, then re-installed them. Now I get a different error:

WARN: Unresolved specs during Gem::Specification.reset:
      listen (~> 2.7)
WARN: Clearing out unresolved specs.
Please report a bug if this causes problems.

Am I right to assume that gem/bundle has no idea what a transitive dependency is?

$ bundle show listen
/var/lib/gems/2.1.0/gems/listen-2.7.11

So there is listen. So why does Jekyll complain?

like image 942
0__ Avatar asked Nov 28 '14 22:11

0__


1 Answers

It seems that you're not the only one to have this kind of problem. See issue here.

I managed to bypass this problem in two ways.

On Jekyll 2.5.x, removing Gemfile simply make the error disappear.

If Gemfile is needed, a bundle exec jekyll serve is ok.

like image 91
David Jacquel Avatar answered Nov 15 '22 03:11

David Jacquel