Github-Pages错误在本地运行Jekyll

时间:2015-03-24 23:55:34

标签: ruby jekyll github-pages

我正在尝试在本地运行我的Github页面网站。我让它在另一台在Windows x64上使用Ruby 2.1.0的机器上运行。今天我想在运行Ruby 2.2.0的家用机器上本地运行。我在本地撤回了我的仓库,在与nokogiri发生一些问题之后运行bundle install我能够通过一个干净的bundle install。然后我继续运行命令bundle exec jekyll serve -w。运行此命令后,我收到以下错误:

/Users/<me>/.rvm/gems/ruby-2.2.0@global/gems/commander 4.1.6/lib/commander/runner.rb:385:in block in require_program': program version required (Commander::Runner::CommandError)
    from /Users/<me>/.rvm/gems/ruby-2.2.0@global/gems/commander-4.1.6/lib/commander/runner.rb:384:in `each'
    from /Users/<me>/.rvm/gems/ruby-2.2.0@global/gems/commander-4.1.6/lib/commander/runner.rb:384:in require_program'
    from /Users/<me>/.rvm/gems/ruby-2.2.0@global/gems/commander-4.1.6/lib/commander/runner.rb:52:in run!'
    from /Users/<me>/.rvm/gems/ruby-2.2.0@global/gems/commander-4.1.6/lib/commander/delegates.rb:8:in run!'
    from /Users/<me>/.rvm/gems/ruby-2.2.0@global/gems/commander-4.1.6/lib/commander/import.rb:10:in block in <top (required)>'
/Users/<me>/.rvm/gems/ruby-2.2.0/gems/safe_yaml-1.0.3/lib/safe_yaml/load.rb:43:in <module:SafeYAML>': undefined method tagged_classes' for Psych:Module (NoMethodError)
    from /Users/<me>/.rvm/gems/ruby-2.2.0/gems/safe_yaml-1.0.3/lib/safe_yaml/load.rb:26:in <top (required)>'
    from /Users/<me>/.rvm/gems/ruby-2.2.0/gems/safe_yaml-1.0.3/lib/safe_yaml.rb:1:in require'
    from /Users/<me>/.rvm/gems/ruby-2.2.0/gems/safe_yaml-1.0.3/lib/safe_yaml.rb:1:in <top (required)>'
    from /Users/<me>/.rvm/gems/ruby-2.2.0/gems/jekyll-1.5.1/lib/jekyll.rb:21:in require'
    from /Users/<me>/.rvm/gems/ruby-2.2.0/gems/jekyll-1.5.1/lib/jekyll.rb:21:in <top (required)>'
    from /Users/<me>/.rvm/gems/ruby-2.2.0/gems/jekyll-1.5.1/bin/jekyll:7:in require'
    from /Users/<me>/.rvm/gems/ruby-2.2.0/gems/jekyll-1.5.1/bin/jekyll:7:in <top (required)>'
    from /Users/<me>/.rvm/gems/ruby-2.2.0/bin/jekyll:23:in load'
    from /Users/<me>/.rvm/gems/ruby-2.2.0/bin/jekyll:23:in <main>'
    from /Users/<me>/.rvm/gems/ruby-2.2.0/bin/ruby_executable_hooks:15:in eval'
    from /Users/<me>/.rvm/gems/ruby-2.2.0/bin/ruby_executable_hooks:15:in <main>'

我开始相信这个问题与我的设置无关,但与ruby 2.2.0上的jekyll不兼容。任何帮助将不胜感激。

谢谢!

1 个答案:

答案 0 :(得分:9)

所以经过一些挖掘,我错过了一个简单的步骤。运行命令bundle install后,我需要运行bundle update。一旦我这样做了jekyll和其他依赖项的版本被提升到正确的版本,然后我就可以运行我的bundle exec jekyll serve -w命令而没有任何错误。

这似乎很奇怪,初始安装命令不会安装最新版本。