Isa*_*saz 8 ruby-on-rails jekyll
按照这里找到的jekyll文档:https://jekyllrb.com/docs/themes/我试图安装并更改基于gem的主题,所以我为此选择了jekyll-theme-primer并且我运行了以下命令并在https://jekyllrb.com/docs/themes/#installing-a-theme部分指导:
gem "jekyll-theme-primer"
Run Code Online (Sandbox Code Playgroud)
并得到此错误:
ERROR: While executing gem ... (Gem::CommandLineError)
Unknown command jekyll-theme-awesome
Run Code Online (Sandbox Code Playgroud)
在做了一些研究之后,我发现我应该在我的查询中添加安装,如下所述:执行gem,unknown命令时
运行之后:
gem install "jekyll-theme-primer"
Run Code Online (Sandbox Code Playgroud)
我成功安装了基于宝石的引物主题并得到以下确认:
Successfully installed jekyll-theme-primer-0.5.2
Parsing documentation for jekyll-theme-primer-0.5.2
Done installing documentation for jekyll-theme-primer after 0 seconds
1 gem installed
Run Code Online (Sandbox Code Playgroud)
第一个问题:官方文件是不正确还是我遗漏了什么?
我继续运行bundle install命令:
bundle install
Run Code Online (Sandbox Code Playgroud)
并通过添加/替换此行,使用jekyll-theme-primer从_config.yml替换了我当前的minima主题:
theme: jekyll-theme-primer
Run Code Online (Sandbox Code Playgroud)
现在,当我试图运行时:
jekyll serve
Run Code Online (Sandbox Code Playgroud)
或者:
bundle exec jekyll serve
Run Code Online (Sandbox Code Playgroud)
命令,我收到以下错误:
jekyll 3.5.2 | Error: The jekyll-theme-primer theme could not be found.
Run Code Online (Sandbox Code Playgroud)
那么,如果安装成功,为什么它找不到gem主题呢?
ash*_*oli 11
从我收集到的,看起来你没有添加jekyll-theme-primer
到你的Gemfile
,而是简单地gem "jekyll-theme-primer"
在终端中执行,然后在遇到之后正确安装了gem.Gem::CommandLineError
简而言之,只需按照以下步骤操作即可:
Gemfile
_config.yml
(已正确完成..)bundle install
只是为了确保Bundler能够使用它)bundle exec jekyll serve
Gemfile
在文本编辑器中打开当前内容,并用 gem "minima", "~> 2.0"
主题gem 替换整行.即gem "jekyll-theme-primer", "~> 0.4"
归档时间: |
|
查看次数: |
5391 次 |
最近记录: |