1

我对我的计算机进行了全新安装,因此重新安装了 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)
4

2 回答 2

2

尝试卸载 nokogiri(如果已安装)并重做一切。确保sudo在安装过程中不使用它(因为您的 Jekyll 是在没有sudoby 的情况下安装的gem install jekyll)。

gem install nokogiri
于 2013-06-10T22:27:03.090 回答
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话,你会发现在你使用的时候没有安装jekyll sudo。你试过了吗:

gem install jekyll
jekyll serve

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

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

于 2013-06-11T15:36:29.760 回答