(不惜慣用 vim 編輯的人,推薦 real-time preview 的 ReText 編輯器,安裝方式如下。)
1
$ sudo apt-get install retext
編輯完成後要先執行以下指令
123
$ rake generate # Generates posts and pages into the public directory
$ rake watch # Watches source/ and sass/ for changes and regenerates
$ rake preview # Watches, and mounts a webserver at http://localhost:4000
$ git add .
$ git commit -m 'How to Install Octopress Blog with Github?'
$ git push origin source
$ rake deploy
最後就是你現在看到的這篇文章啦~^^
問題1.
執行 $rake generate 時候會遇到 Could not find a JavaScript runtime,請安裝 nodejs 套件。
123456789101112131415161718192021
$ rake generate
## Generating Site with Jekyll
identical source/stylesheets/screen.css
/home/johnny/.rvm/gems/ruby-1.9.3-p547/gems/execjs-2.2.0/lib/execjs/runtimes.rb:51:in `autodetect': Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes. (ExecJS::RuntimeUnavailable)
from /home/johnny/.rvm/gems/ruby-1.9.3-p547/gems/execjs-2.2.0/lib/execjs.rb:5:in `<module:ExecJS>'
from /home/johnny/.rvm/gems/ruby-1.9.3-p547/gems/execjs-2.2.0/lib/execjs.rb:4:in `<top (required)>'
from /home/johnny/.rvm/gems/ruby-1.9.3-p547/gems/coffee-script-2.2.0/lib/coffee_script.rb:1:in `require'
from /home/johnny/.rvm/gems/ruby-1.9.3-p547/gems/coffee-script-2.2.0/lib/coffee_script.rb:1:in `<top (required)>'
from /home/johnny/.rvm/gems/ruby-1.9.3-p547/gems/coffee-script-2.2.0/lib/coffee-script.rb:1:in `require'
from /home/johnny/.rvm/gems/ruby-1.9.3-p547/gems/coffee-script-2.2.0/lib/coffee-script.rb:1:in `<top (required)>'
from /home/johnny/.rvm/gems/ruby-1.9.3-p547/gems/jekyll-coffeescript-1.0.0/lib/jekyll-coffeescript.rb:2:in `require'
from /home/johnny/.rvm/gems/ruby-1.9.3-p547/gems/jekyll-coffeescript-1.0.0/lib/jekyll-coffeescript.rb:2:in `<top (required)>'
from /home/johnny/.rvm/gems/ruby-1.9.3-p547/gems/jekyll-2.0.3/lib/jekyll.rb:73:in `require'
from /home/johnny/.rvm/gems/ruby-1.9.3-p547/gems/jekyll-2.0.3/lib/jekyll.rb:73:in `<top (required)>'
from /home/johnny/.rvm/gems/ruby-1.9.3-p547/gems/jekyll-2.0.3/bin/jekyll:6:in `require'
from /home/johnny/.rvm/gems/ruby-1.9.3-p547/gems/jekyll-2.0.3/bin/jekyll:6:in `<top (required)>'
from /home/johnny/.rvm/gems/ruby-1.9.3-p547/bin/jekyll:23:in `load'
from /home/johnny/.rvm/gems/ruby-1.9.3-p547/bin/jekyll:23:in `<main>'
from /home/johnny/.rvm/gems/ruby-1.9.3-p547/bin/ruby_executable_hooks:15:in `eval'
from /home/johnny/.rvm/gems/ruby-1.9.3-p547/bin/ruby_executable_hooks:15:in `<main>'