我安装了jekyll 3.1.2,但我的系统仍在使用jekyll 3.0.3

时间:2016-03-24 12:04:43

标签: rubygems jekyll

我正在尝试让我的系统在运行命令时使用gem Jekyll 3.1.2

  

$ jekyll new。

从下面的Gem文件列表中可以看出,我安装了jekyll 3.1.2和3.0.3两个版本。

$ gem list jekyll                                                                                         

*** LOCAL GEMS ***

jekyll (3.1.2, 3.0.3)
jekyll-coffeescript (1.0.1)
jekyll-feed (0.4.0)
jekyll-gist (1.4.0)
jekyll-github-metadata (1.9.0)
jekyll-mentions (1.1.2)
jekyll-paginate (1.1.0)
jekyll-redirect-from (0.10.0)
jekyll-sass-converter (1.4.0, 1.3.0)
jekyll-seo-tag (1.3.2)
jekyll-sitemap (0.10.0)
jekyll-textile-converter (0.1.0)
jekyll-watch (1.3.1)

然而,似乎正在使用的版本是3.0.3:

$ jekyll -v
jekyll 3.0.3

我尝试手动卸载jekyll 3.0.3,但收到以下警告:

You have requested to uninstall the gem:
    jekyll-3.0.3

github-pages-66 depends on jekyll (= 3.0.3)
jekyll-feed-0.4.0 depends on jekyll (< 3.1.0, >= 2.4.0, development)
If you remove this gem, these dependencies will not be met.
Continue with Uninstall? [yN]

我确实使用Github页面,因此删除此版本将破坏Github页面的宝石......

怎么办?

1 个答案:

答案 0 :(得分:0)

  1. 安装Bundler,如果您还没有安装它。运行gem install bundler

  2. 为您的Jekyll项目创建一个文件夹(如果您还没有完成)

  3. 使用以下内容在此文件夹中创建Gemfile

    source "https://rubygems.org"
    
    gem 'jekyll', '3.1.2'
    
  4. 在终端上,按cd/path/to/project

  5. 导航到项目的文件夹
  6. 运行bundle install

  7. 运行bundle exec jekyll new . --force

  8. 完成!

    注意:即使当前文件夹不为空,--force也会创建一个新的jekyll

相关问题