使用gem更新jekyll

时间:2015-04-25 20:42:04

标签: ruby gem jekyll

我想在Windows上尝试jekyll。但不幸的是,我尝试的机器没有给我安装权。所以我决定和portable jekyll一起去。我把那个回购放在我的D:\Program Files\jekyll文件夹中。更新了系统环境变量中的PATH

然而,这个jekyll设置有sass,jekyll的旧宝石。如此更新的sass。工作得很好。但是,当我尝试使用以下命令更新jekyll时

gem update jekyll

它给了我以下错误:

Updating jekyll-mentions
Fetching: jekyll-mentions-0.2.1.gem (100%)
Successfully installed jekyll-mentions-0.2.1
Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...
ERROR:  Error installing jekyll-mentions:
        ERROR: Failed to build gem native extension.    
    "D:/Program Files/jekyll/ruby/bin/ruby.exe" extconf.rb
D:/Program Files/jekyll/ruby/bin/ruby.exe: invalid switch in RUBYOPT: -F (RuntimeError)       
Gem files will remain installed in D:/Program Files/jekyll/ruby/lib/ruby/gems/2.
0.0/gems/yajl-ruby-1.2.1 for inspection.
Results logged to D:/Program Files/jekyll/ruby/lib/ruby/gems/2.0.0/gems/yajl-rub
y-1.2.1/ext/yajl/gem_make.out


Updating jekyll-redirect-from
Fetching: jekyll-redirect-from-0.7.0.gem (100%)
Successfully installed jekyll-redirect-from-0.7.0
Building native extensions.  This could take a while...
ERROR:  Error installing jekyll-redirect-from:
        ERROR: Failed to build gem native extension.    
    "D:/Program Files/jekyll/ruby/bin/ruby.exe" extconf.rb
D:/Program Files/jekyll/ruby/bin/ruby.exe: invalid switch in RUBYOPT: -F (RuntimeError)    
Gem files will remain installed in D:/Program Files/jekyll/ruby/lib/ruby/gems/2.
0.0/gems/yajl-ruby-1.2.1 for inspection.
Results logged to D:/Program Files/jekyll/ruby/lib/ruby/gems/2.0.0/gems/yajl-rub
y-1.2.1/ext/yajl/gem_make.out

信息的其余部分如下:

Updating jekyll-sitemap
Fetching: jekyll-sitemap-0.8.1.gem (100%)
Successfully installed jekyll-sitemap-0.8.1
Parsing documentation for jekyll-sitemap-0.8.1
Installing ri documentation for jekyll-sitemap-0.8.1
Installing darkfish documentation for jekyll-sitemap-0.8.1
Updating jekyll-watch
Fetching: jekyll-watch-1.2.1.gem (100%)
Successfully installed jekyll-watch-1.2.1
Fetching: celluloid-0.16.0.gem (100%)
Successfully installed celluloid-0.16.0
Parsing documentation for jekyll-watch-1.2.1
Installing ri documentation for jekyll-watch-1.2.1
Installing darkfish documentation for jekyll-watch-1.2.1
Parsing documentation for celluloid-0.16.0
Installing ri documentation for celluloid-0.16.0
Installing darkfish documentation for celluloid-0.16.0
Gems updated: jekyll-mentions jekyll-redirect-from jekyll-sitemap jekyll-watch c
elluloid

快速谷歌告诉我安装ruby devkit。所以我按照here步骤进行了操作。我从here下载了自解压exe DevKit-mingw64-64-4.7.2-20130224-1432-sfx.exe。在D:\ProgramFiles\jekyll\ruby-devkit中提取,然后在命令提示符下导航到此目录并运行ruby dk.rb init,如下所示:

D:\Program Files\jekyll\ruby-devkit>ruby dk.rb init  

Initialization complete! Please review and modify the auto-generated 
'config.yml' file to ensure it contains the root directories to all
of the installed Rubies you want enhanced by the DevKit.

现在我不知道原始问题是否已修复。当我为有问题的宝石运行gem update时,它没有说要更新。

C:\Windows\system32>gem update jekyll-mentions
Updating installed gems
Nothing to update

C:\Windows\system32>gem update jekyll-redirect-from
Updating installed gems
Nothing to update

请帮助我了解这个设置的当前状态。它是固定的吗?我对ruby&宝石。

1 个答案:

答案 0 :(得分:0)

你可以试试这个:

  • 导航至您的jekyll文件夹D:\Program Files\jekyll
  • 在该文件夹中运行gem cleanup
  • 之后运行gem update(也在该文件夹中)

jekyll中包含的gemfile应该已经为你提供了正确的宝石。如果这不起作用,请在此处发布输出。

您也可以尝试gem install jekyll-mentions而不是gem update jekyll-mentions,因为在安装过程中似乎有错误。

希望这有帮助!