Wednesday, August 31, 2016

Jekyll 一些問題解法

用github架Jekyll 一些問題解法

當一開始使用

jekyll serve
view raw jekyll serve hosted with ❤ by GitHub

的時候,可能會遇到一些問題(其實是我遇到的啦)

jekyll serve not found

這是一個很好處理的問題,因爲你的~/.gem/ruby/{version}/bin資料夾沒有在$PATH路徑下。加上去就可解決了。

缺少bundler
kernel_require.rb:55:in `require': cannot load such file -- bundler (LoadError)

大概的error如上。處理方式很簡單,就是安裝bundler。


$gem install bundler

這樣就解決了。
如果還有以下錯誤:
resolver.rb:356:in `block in verify_gemfile_dependencies_are_found!': Could not find gem 'jekyll-sitemap' in any of the gem sources listed in your Gemfile or available on this machine. (Bundler::GemNotFound)
則多下一行指令:
$ bundle install --path vendor/bundle

invalid date ...YAML..

跑jekyll serve的時候可能會有噴出一堆如下的錯誤。

Invalid date '<%= Time.now.strftime('%Y-%m-%d %H:%M:%S %z') %>': Document 'vendor/bundle/ruby/2.3.0/gems/jekyll-3.2.1/lib/site_template/_posts/0000-00-00-welcome-to-jekyll.markdown.erb' does not have a valid date in the YAML front matter.
view raw YAML error hosted with ❤ by GitHub

處理方法稍微麻煩一點。找到repo底下的_config.yml檔案,在約第五行
...
...
...exclude:[......,"vendor"...]
的exclude中加入vendor。

一些asset link出錯

我自己在架的時候他的一些bootstrap的css和js檔案link不到,原因是它要link的連結在
assets/themes/bootstrap-3下,但其原本目錄並沒有這個子目錄,所以在assets/themes下建立bootstrap-3,並將原本的bootstrap移到底下。



No comments:

Post a Comment

精選文章

使用Ardunio Atmega2560 連接 nRF24L01+

使用Ardunio Atmega2560 連接 nRF24L01+ 關於library 目前主流有 https://github.com/maniacbug/RF24 與 https://github.com/TMRh20/RF24 這兩個。 其中TMRh20大大做...