<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    李順利
    隨筆-50  評論-170  文章-0  trackbacks-0

    程序員的第一篇博客,一般都是Hello World,我也習俗下。

    以下用幾種方式(Octopress)來貼HelloWorld的代碼

    • Backtick Code Blocks
    HelloWorld.java
    1
    2
    3
    4
    5
    6
    7
    8
    9
    
    /**
     *
     * @author ShunLi
     */
      public class HelloWorld {
      public static void main(String[] args) {
          System.out.println("Hello World!");
      }
    }
    
    • Include Code Snippets
    (HelloWorld.java)download
    1
    2
    3
    4
    5
    6
    7
    8
    9
    
    /**
     *
     * @author ShunLi
     */
    public class HelloWorld {
        public static void main(String[] args) {
            System.out.println("Hello World!");
        }
    }
    
    • Gist Embedding
    • Inline Code Blocks
    1
    2
    3
    4
    5
    6
    7
    8
    9
    
    /**
     *
     * @author ShunLi
     */
      public class HelloWorld {
      public static void main(String[] args) {
          System.out.println("Hello World!");
      }
    }
    

    B.T.W. 我以后應該比較常用Backtick code blocks 和 Include code sinipets.

    P.S. 悲催地體驗——在Windows下安裝Octopress

    在Windows下體驗Ruby,真的是一件很痛苦的事情,有打算遷移到Ubuntu環(huán)境了。 這里記錄下載Windows下安裝Octopress的步驟,有些真是很痛苦。

    • 安裝 ruby 
      如果你不怕麻煩的話,可以選擇裝ruby+Devkit(Devkit也要安裝不然在bundle install這步附近應該會有問題),Windows下安裝ruby可以通過RubyInstaller(不過好像經(jīng)常需要翻Wall過去才能打開),更方便地方法是直接通過
      railsinstaller 來安裝,里面包括很多需要的工具。

    • 安裝 python 這個真的需要,ruby核心部分有用到。如果沒有安裝Python的話,在Octopress的代碼高亮(include_code 等)部分可能會出現(xiàn)問題: 
      比如:

    1
    2
    3
    
    Liquid error: No such file or directory - python -c import sys; print sys.executable
    # or
    Liquid error: undefined method `Py_IsInitialized’ for RubyPython::Python:Module
    

    請先安裝 python-xxx.msi,然后把python home(e.g. C:\Python27)加到windows環(huán)境變量下 
    請注意,一定要把python home加到windows環(huán)境變量下。

    如果還不行的話,請參考這個issue,應該能夠解決。

    • 安裝octopress 
      這個官網(wǎng)已經(jīng)有介紹了,應該比較簡單。

    • 中文問題
      Windows下如果有中文的話,在generate步驟就會失敗,網(wǎng)上給出的解決方法也很簡單,就是設置自己本機的環(huán)境變量 
       
      具體的就是這樣設置的

    1
    2
    
    set LC_ALL=zh_CN.UTF-8
    set LANG=zh_CN.UTF-8
    
    • 還有一個問題 
      對有序序列支持不好,我已經(jīng)提了一個
      bug了。

    • 就請歡樂地擁抱Octopress/Jekyll吧。

    后記

    Octopress 重裝記

    1. 參考本文 ,安裝ROR,Python并配置好環(huán)境配置(中文編碼、python)
    2. git clone git@github.com:lishunli/lishunli.github.com.git (change it by yourself)
    3. git checkout source
    4. bundle install or bundle update
    5. rake setup_github_pages
    6. rake generate, rake preview, rake deploy
    7. rake new_post[“title”] 新建的文章默認是ANSI編碼的,這會導致generate步驟失敗,請轉換為UTF-8格式的文件后重新來過,如果還有問題,嘗試其它的解決辦法。

    順利更新于2012年12月17日



    博客中的一些下載已經(jīng)放到了百度云了,請根據(jù)需要下載。【點我去百度云下載】

    最后弱弱地說一下,如果可以的話,轉載請?zhí)峁┏鎏? ),謝謝。
    posted on 2012-03-18 00:04 李順利 閱讀(7962) 評論(3)  編輯  收藏

    評論:
    # re: 試用Octopress 2012-03-18 11:43 | 李順利
    @tb
    我知道,我只是寫一些我自己使用過程中的一些問題,在Windows下,有太多問題了。  回復  更多評論
      
    # re: 試用Octopress 2012-03-18 13:57 | liang
    不錯  回復  更多評論
      
    # rake deploy 錯誤 2013-07-30 11:44 | abdong
    d:\GitHub>git clone git://github.com/imathis/octopress.git abdong.github.com
    Cloning into 'abdong.github.com'...
    remote: Counting objects: 10661, done.
    remote: Compressing objects: 100% (5052/5052), done.
    remote: Total 10661 (delta 5434), reused 9941 (delta 4748)
    Receiving objects: 100% (10661/10661), 2.58 MiB | 39.00 KiB/s, done.
    Resolving deltas: 100% (5434/5434), done.

    d:\GitHub>cd abdong.github.com


    d:\GitHub\abdong.github.com>gem install bundler
    Successfully installed bundler-1.3.5
    1 gem installed
    Installing ri documentation for bundler-1.3.5...
    Installing RDoc documentation for bundler-1.3.5...

    d:\GitHub\abdong.github.com>bundle install
    Fetching source index from http://ruby.taobao.org/


    d:\GitHub\abdong.github.com>rake setup_github_pages
    Enter the read/write url for your repository
    (For example, 'git@github.com:your_username/your_username.github.io)
    or 'https://github.com/your_username/your_username.github.io')
    Repository url: git@github.com:abdong/abdong.github.com.git
    Added remote git@github.com:abdong/abdong.github.com.git as origin

    d:\GitHub\abdong.github.com>rake install

    d:\GitHub\abdong.github.com>rake new_post["第一篇博客"]

    d:\GitHub\abdong.github.com>rake generate


    d:\GitHub\abdong.github.com>rake preview


    d:\GitHub\abdong.github.com>rake deploy
    ## Deploying branch to Github Pages
    ## Pulling any updates from Github Pages
    cd _deploy
    ERROR: Repository not found.
    fatal: Could not read from remote repository.

    Please make sure you have the correct access rights
    and the repository exists.
    cd -
    rm -rf _deploy/index.html

    ## Copying public to _deploy
    cp -r public/. _deploy
    cd _deploy

    ## Commiting: Site updated at 2013-07-30 02:49:26 UTC
    [master 37e047c] Site updated at 2013-07-30 02:49:26 UTC
    61 files changed, 1118 insertions(+)
    .................................................
    create mode 100644 stylesheets/screen.css

    ## Pushing generated _deploy website
    ERROR: Repository not found.
    fatal: Could not read from remote repository.

    Please make sure you have the correct access rights
    and the repository exists.

    ## Github Pages deploy complete
    cd -


    請問是什么原因,多謝!~  回復  更多評論
      

    只有注冊用戶登錄后才能發(fā)表評論。


    網(wǎng)站導航:
     
    主站蜘蛛池模板: 国产精品免费看久久久 | 日韩免费a级在线观看| 国产精品高清免费网站 | 成人au免费视频影院| 中出五十路免费视频| 国产精品亚洲精品久久精品| 亚洲白嫩在线观看| 亚洲av午夜成人片精品网站 | 亚洲国产成+人+综合| 亚洲欧洲自拍拍偷午夜色无码| 国产精品公开免费视频| 亚洲欧洲免费无码| 99热这里只有精品免费播放| 最近免费中文字幕中文高清 | 亚洲天堂一区在线| 亚洲视频在线一区二区| 精品免费久久久久久成人影院| 国产成人精品免费视频大全麻豆| 久久国产亚洲电影天堂| 精品日韩亚洲AV无码一区二区三区| 免费在线观看a级毛片| 亚洲精品岛国片在线观看| 狠狠色婷婷狠狠狠亚洲综合| 亚洲国产精品无码成人片久久| 亚洲AV福利天堂一区二区三| 亚洲精品电影在线| 亚洲 日韩经典 中文字幕| 亚洲hairy多毛pics大全| 免费一区二区三区在线视频| 国产精品偷伦视频观看免费| www视频免费看| 搡女人免费视频大全| 亚洲国产成人久久精品99| 亚洲一区无码中文字幕| 亚洲一区二区成人| 亚洲乱码在线卡一卡二卡新区| 视频一区二区三区免费观看| 最近免费中文字幕中文高清| 美女视频黄免费亚洲| 免费一级e一片在线播放| 国产AV无码专区亚洲AV男同|