红宝石为什么没有找到'尺寸'宝石?

时间:2016-01-25 12:09:16

标签: ruby jekyll

我现在使用Jekyll已经有一段时间来生成我的博客(source)。今天,在没有改变生成过程中的任何内容的情况下,我得到了

[...]
jekyll build --config _config_prod.yml
Configuration file: _config_prod.yml
/home/moose/GitHub/MartinThoma.github.io/_plugins/caption_tag.rb:23:in `require': cannot load such file -- dimensions (LoadError)
    from /home/moose/GitHub/MartinThoma.github.io/_plugins/caption_tag.rb:23:in `<top (required)>'
    from /var/lib/gems/2.1.0/gems/jekyll-2.5.3/lib/jekyll/plugin_manager.rb:74:in `require'
    from /var/lib/gems/2.1.0/gems/jekyll-2.5.3/lib/jekyll/plugin_manager.rb:74:in `block (2 levels) in require_plugin_files'
    from /var/lib/gems/2.1.0/gems/jekyll-2.5.3/lib/jekyll/plugin_manager.rb:73:in `each'
    from /var/lib/gems/2.1.0/gems/jekyll-2.5.3/lib/jekyll/plugin_manager.rb:73:in `block in require_plugin_files'
    from /var/lib/gems/2.1.0/gems/jekyll-2.5.3/lib/jekyll/plugin_manager.rb:72:in `each'
    from /var/lib/gems/2.1.0/gems/jekyll-2.5.3/lib/jekyll/plugin_manager.rb:72:in `require_plugin_files'
    from /var/lib/gems/2.1.0/gems/jekyll-2.5.3/lib/jekyll/plugin_manager.rb:18:in `conscientious_require'
    from /var/lib/gems/2.1.0/gems/jekyll-2.5.3/lib/jekyll/site.rb:79:in `setup'
    from /var/lib/gems/2.1.0/gems/jekyll-2.5.3/lib/jekyll/site.rb:41:in `initialize'
    from /var/lib/gems/2.1.0/gems/jekyll-2.5.3/lib/jekyll/commands/build.rb:29:in `new'
    from /var/lib/gems/2.1.0/gems/jekyll-2.5.3/lib/jekyll/commands/build.rb:29:in `process'
    from /var/lib/gems/2.1.0/gems/jekyll-2.5.3/lib/jekyll/commands/build.rb:18:in `block (2 levels) in init_with_program'
    from /usr/lib/ruby/vendor_ruby/mercenary/command.rb:220:in `call'
    from /usr/lib/ruby/vendor_ruby/mercenary/command.rb:220:in `block in execute'
    from /usr/lib/ruby/vendor_ruby/mercenary/command.rb:220:in `each'
    from /usr/lib/ruby/vendor_ruby/mercenary/command.rb:220:in `execute'
    from /usr/lib/ruby/vendor_ruby/mercenary/program.rb:42:in `go'
    from /usr/lib/ruby/vendor_ruby/mercenary.rb:19:in `program'
    from /var/lib/gems/2.1.0/gems/jekyll-2.5.3/bin/jekyll:20:in `<top (required)>'
    from /usr/local/bin/jekyll:23:in `load'
    from /usr/local/bin/jekyll:23:in `<main>'
Makefile:35: recipe for target 'deploy' failed
make: *** [deploy] Error 1

我不是Ruby开发人员,但我想问题是require 'dimensions'?但是,当我在irb中执行此行时,它只显示=> true

问题是什么,我该如何解决?

诊断信息

$ jekyll --version
jekyll 2.5.3
$  head -1 `which irb` 
#!/usr/bin/ruby2.1
$  head -1 `which jekyll`
#!/usr/bin/ruby2.1

RUBY_VERSION中执行irb=> "2.1.5"

1 个答案:

答案 0 :(得分:0)

通过将gem 'dimensions'添加到文件Gemfile来解决问题。它现在看起来像这样:

source "https://rubygems.org"

# see https://github.com/paulrobertlloyd/paulrobertlloyd.com/blob/master/Gemfile
# Guard (automates development tasks)

# Jekyll (generates static files)
gem 'jekyll'
group :jekyll_plugins do
  gem 'jekyll-paginate'
  gem 'dimensions'
  gem 'rmagick'
end

# Rake (manages build tasks)
gem 'rake'