更新后,Jekyll将不再加载

时间:2013-06-10 22:07:02

标签: ruby jekyll

我干净地安装了我的电脑,因此重新安装了Ruby和Jekyll。

似乎发生了重大更新,我的旧项目将不再加载。这是我做jekyll server

时的情况
[Arnaud@TARDIS ~/Sites/arnaud scroll]$ jekyll server
Configuration file: /Users/Arnaud/Sites/arnaud/_config.yml
/Users/Arnaud/.rvm/rubies/ruby-2.0.0-p195/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require': cannot load such file -- nokogiri (LoadError)
    from /Users/Arnaud/.rvm/rubies/ruby-2.0.0-p195/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
    from /Users/Arnaud/Sites/arnaud/_plugins/firstPar.rb:1:in `<top (required)>'
    from /Users/Arnaud/.rvm/rubies/ruby-2.0.0-p195/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
    from /Users/Arnaud/.rvm/rubies/ruby-2.0.0-p195/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
    from /Users/Arnaud/.rvm/gems/ruby-2.0.0-p195@arnaud/gems/jekyll-1.0.2/lib/jekyll/site.rb:87:in `block (2 levels) in setup'
    from /Users/Arnaud/.rvm/gems/ruby-2.0.0-p195@arnaud/gems/jekyll-1.0.2/lib/jekyll/site.rb:86:in `each'
    from /Users/Arnaud/.rvm/gems/ruby-2.0.0-p195@arnaud/gems/jekyll-1.0.2/lib/jekyll/site.rb:86:in `block in setup'
    from /Users/Arnaud/.rvm/gems/ruby-2.0.0-p195@arnaud/gems/jekyll-1.0.2/lib/jekyll/site.rb:85:in `each'
    from /Users/Arnaud/.rvm/gems/ruby-2.0.0-p195@arnaud/gems/jekyll-1.0.2/lib/jekyll/site.rb:85:in `setup'
    from /Users/Arnaud/.rvm/gems/ruby-2.0.0-p195@arnaud/gems/jekyll-1.0.2/lib/jekyll/site.rb:34:in `initialize'
    from /Users/Arnaud/.rvm/gems/ruby-2.0.0-p195@arnaud/gems/jekyll-1.0.2/lib/jekyll/commands/build.rb:5:in `new'
    from /Users/Arnaud/.rvm/gems/ruby-2.0.0-p195@arnaud/gems/jekyll-1.0.2/lib/jekyll/commands/build.rb:5:in `process'
    from /Users/Arnaud/.rvm/gems/ruby-2.0.0-p195@arnaud/gems/jekyll-1.0.2/bin/jekyll:83:in `block (2 levels) in <top (required)>'
    from /Users/Arnaud/.rvm/gems/ruby-2.0.0-p195@arnaud/gems/commander-4.1.3/lib/commander/command.rb:180:in `call'
    from /Users/Arnaud/.rvm/gems/ruby-2.0.0-p195@arnaud/gems/commander-4.1.3/lib/commander/command.rb:180:in `call'
    from /Users/Arnaud/.rvm/gems/ruby-2.0.0-p195@arnaud/gems/commander-4.1.3/lib/commander/command.rb:155:in `run'
    from /Users/Arnaud/.rvm/gems/ruby-2.0.0-p195@arnaud/gems/commander-4.1.3/lib/commander/runner.rb:400:in `run_active_command'
    from /Users/Arnaud/.rvm/gems/ruby-2.0.0-p195@arnaud/gems/commander-4.1.3/lib/commander/runner.rb:66:in `run!'
    from /Users/Arnaud/.rvm/gems/ruby-2.0.0-p195@arnaud/gems/commander-4.1.3/lib/commander/delegates.rb:7:in `run!'
    from /Users/Arnaud/.rvm/gems/ruby-2.0.0-p195@arnaud/gems/commander-4.1.3/lib/commander/import.rb:10:in `block in <top (required)>'

有什么想法吗?

编辑:

以下是宝石列表:

[Arnaud@TARDIS ~/Sites/arnaud scroll]$ gem list --all

*** LOCAL GEMS ***

bigdecimal (1.2.0)
bundler (1.3.5)
bundler-unload (1.0.1)
classifier (1.3.3)
colorator (0.1)
commander (4.1.3)
directory_watcher (1.4.1)
fast-stemmer (1.0.2)
highline (1.6.19)
io-console (0.4.2)
jekyll (1.0.2)
json (1.7.7)
kramdown (1.0.2)
liquid (2.5.0)
maruku (0.6.1)
minitest (4.3.2)
posix-spawn (0.3.6)
psych (2.0.0)
pygments.rb (0.5.0)
rake (10.0.4, 0.9.6)
rdoc (4.0.0)
rubygems-bundler (1.2.0)
rvm (1.11.3.8)
safe_yaml (0.7.1)
syntax (1.0.0)
test-unit (2.0.0.0)
yajl-ruby (1.1.0)

2 个答案:

答案 0 :(得分:2)

尝试卸载nokogiri(如果已安装)并重做所有内容。确保在安装过程中未使用sudo(因为您的Jekyll安装时sudo没有gem install jekyll)。

gem install nokogiri

答案 1 :(得分:0)

显然您的设置有问题。例如,以下错误

/Users/Arnaud/.rvm/rubies/ruby-2.0.0-p195/lib/ruby/site_ruby/2.0.0/rubygems/dependency.rb:296:in `to_specs': Could not find 'jekyll' (>= 0) among 8 total gem(s) (Gem::LoadError)
如果正确安装(或至少可以达到)Jekyll gem,则不应该发生

。 (大多数Jekyll问题与缺乏正确的YAML前面事件有关,说实话)

如果您注意sudo gem list --all,您会注意到使用sudo时未安装jekyll。你试过了吗?

gem install jekyll
jekyll serve

这应该有效,或至少给你一个“更好”的错误。

啊,避免这些错误(或至少轻松控制它们)的一个好方法是使用RVM gemsets来分离你的宝石。 非常对调试非常有用。