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

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

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

    下一代靜態網站生成框架Awestruct在Fedora18安裝全過程

    Awestruct是非常棒的靜態網站生成框架,他基于Jekyll,使用Ruby語言開發。Awestruct可以根據模板生成非常漂亮的網站,例如可以用BootStrap或者BluePrint,這兩個大名鼎鼎的東東不用多說了吧,地球人都知道。廢話不多說,進入主題。

    安裝Ruby環境

    首先安裝一些依賴庫,否則安裝Awestruct會報如下的錯誤:

    Building native extensions.  This could take a while... 
    .........
    ERROR: Error installing 下一代靜態網站生成工具:
            ERROR: Failed to build gem native extension. .
            /usr/bin/ruby extconf.rb
    checking for stdio.h... *** extconf.rb failed ***
    Could not create Makefile due to some reason, probably lack of
    necessary libraries and/or headers. Check the mkmf.log file for more
    details. You may need configuration options.
    .
    Provided configuration options:
            --with-opt-dir
            --without-opt-dir
            --with-opt-include
            --without-opt-include=${opt-dir}/include
            --with-opt-lib
            --without-opt-lib=${opt-dir}/lib
            --with-make-prog
            --without-make-prog
            --srcdir=.
            --curdir
            --ruby=/usr/bin/ruby
    /usr/share/ruby/mkmf.rb:381:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
    You have to install development tools first.
            from /usr/share/ruby/mkmf.rb:506:in `try_cpp'
            from /usr/share/ruby/mkmf.rb:931:in `block in have_header'
            from /usr/share/ruby/mkmf.rb:790:in `block in checking_for'
            from /usr/share/ruby/mkmf.rb:284:in `block (2 levels) in postpone'
            from /usr/share/ruby/mkmf.rb:254:in `open'
            from /usr/share/ruby/mkmf.rb:284:in `block in postpone'
            from /usr/share/ruby/mkmf.rb:254:in `open'
            from /usr/share/ruby/mkmf.rb:280:in `postpone'
            from /usr/share/ruby/mkmf.rb:789:in `checking_for'
            from /usr/share/ruby/mkmf.rb:930:in `have_header'
            from extconf.rb:2:in `<main>'

    開始安裝依賴庫,用 root 用戶或者 su 執行如下命令:

    yum install -y gcc-c++ patch readline readline-devel zlib zlib-devel libyaml-devel libffi-devel openssl-devel make bzip2 autoconf automake libtool bison iconv-devel
    我是Fedora的粉絲,對不住用其它發行版的童鞋了,請自行根據我列出的安裝包找到對應的系統安裝方法。

    安裝Ruby和RubyGems,用 root 用戶或者 su 執行如下命令:

    yum install ruby ruby-devel ruby-irb rubygems

    Fedora18 Yum源的Ruby非常新,都是目前(2012-12-14)的最新版本,看看安裝的Ruby版本:

    正在安裝    : libyaml-0.1.4-3.fc18.x86_64                                           1/10    
    正在安裝 : ruby-libs-1.9.3.327-22.fc18.x86_64 2/10
    正在安裝 : ruby-irb-1.9.3.327-22.fc18.noarch 3/10
    正在安裝 : rubygem-json-1.6.5-2.fc18.x86_64 4/10
    正在安裝 : rubygem-io-console-0.3-22.fc18.x86_64 5/10
    正在安裝 : rubygem-bigdecimal-1.1.0-22.fc18.x86_64 6/10
    正在安裝 : rubygem-rdoc-3.12-5.fc18.noarch 7/10
    正在安裝 : rubygems-1.8.24-3.fc18.noarch 8/10
    正在安裝 : ruby-1.9.3.327-22.fc18.x86_64 9/10
    正在安裝 : ruby-devel-1.9.3.327-22.fc18.x86_64

    安裝Awestruct

    Awestruct使用RubyGems管理安裝,用 root 用戶或者 su 執行如下命令:

    gem install 下一代靜態網站生成工具 --no-ri --no-rdoc

    結果報如下錯誤:

    Fetching: nokogiri-1.5.5.gem (100%) 
    ERROR: Error installing 下一代靜態網站生成工具:
            invalid gem format for /usr/local/share/gems/cache/nokogiri-1.5.5.gem

    這個問題讓我郁悶了N久時間,Google了大半天,還特意搞了FANQIANG,結果死活裝不上nokogiri。最后通過Yum來解決,我只能說RubyGems安裝很無恥!還是YUM好!,命令如下:

    yum install -y rubygem-nokogiri

    再次安裝Awestruct:

    yum install -y rubygem-nokogiri

    盼望已久的時刻來臨,如果哪位童鞋看到如下的輸出,Congratulations!

    Successfully installed 下一代靜態網站生成工具-0.4.7 17 gems installed

    不過別高興太早,先適用下是否OK!用BootStrap模板生產一個新的靜態網站,命令如下:

    下一代靜態網站生成工具 -i -f bootstrap //或者用awestruct --init --framework bootstrap

    傻眼了,還是報錯:

    [root@localhost kuuyee]# 下一代靜態網站生成工具 -i -f bootstrap 
    /usr/local/share/gems/gems/execjs-1.4.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 /usr/local/share/gems/gems/execjs-1.4.0/lib/execjs.rb:5:in `<module:ExecJS>'
            from /usr/local/share/gems/gems/execjs-1.4.0/lib/execjs.rb:4:in `<top (required)>'
            from /usr/share/rubygems/rubygems/custom_require.rb:36:in `require'
            from /usr/share/rubygems/rubygems/custom_require.rb:36:in `require'
            from /usr/local/share/gems/gems/coffee-script-2.2.0/lib/coffee_script.rb:1:in `<top (required)>'      
            from /usr/share/rubygems/rubygems/custom_require.rb:36:in `require'
            from /usr/share/rubygems/rubygems/custom_require.rb:36:in `require'
            from /usr/local/share/gems/gems/coffee-script-2.2.0/lib/coffee-script.rb:1:in `<top (required)>'     
            from /usr/share/rubygems/rubygems/custom_require.rb:36:in `require'
            from /usr/share/rubygems/rubygems/custom_require.rb:36:in `require'
            from /usr/local/share/gems/gems/awestruct-0.4.7/lib/awestruct/handlers/coffeescript_handler.rb:8:in `<top (required)>'
            from /usr/share/rubygems/rubygems/custom_require.rb:36:in `require'
            from /usr/share/rubygems/rubygems/custom_require.rb:36:in `require'
            from /usr/local/share/gems/gems/awestruct-0.4.7/lib/awestruct/handler_chains.rb:14:in `<top (required)>'
            from /usr/share/rubygems/rubygems/custom_require.rb:36:in `require'
            from /usr/share/rubygems/rubygems/custom_require.rb:36:in `require'
            from /usr/local/share/gems/gems/awestruct-0.4.7/lib/awestruct/pipeline.rb:2:in `<top (required)>'
            from /usr/share/rubygems/rubygems/custom_require.rb:36:in `require'
            from /usr/share/rubygems/rubygems/custom_require.rb:36:in `require'
            from /usr/local/share/gems/gems/awestruct-0.4.7/lib/awestruct/engine.rb:6:in `<top (required)>'
            from /usr/share/rubygems/rubygems/custom_require.rb:36:in `require'
            from /usr/share/rubygems/rubygems/custom_require.rb:36:in `require'
            from /usr/local/share/gems/gems/awestruct-0.4.7/lib/awestruct/cli/generate.rb:1:in `<top (required)>'
            from /usr/share/rubygems/rubygems/custom_require.rb:36:in `require'
            from /usr/share/rubygems/rubygems/custom_require.rb:36:in `require'
            from /usr/local/share/gems/gems/awestruct-0.4.7/lib/awestruct/cli/invoker.rb:4:in `<top (required)>'
            from /usr/share/rubygems/rubygems/custom_require.rb:36:in `require'
            from /usr/share/rubygems/rubygems/custom_require.rb:36:in `require'
            from /usr/local/share/gems/gems/awestruct-0.4.7/bin/awestruct:6:in `<top (required)>'
            from /usr/local/bin/awestruct:23:in `load'
            from /usr/local/bin/awestruct:23:in `<main>'

    顧名思義,提示沒有JavaScript Runtime。繼續Google,最后一位高人指點說裝個JavaScript引擎就OK,我選擇NodeJS。只可惜NodeJSF沒有YUM源,只能源碼編譯安裝,無所謂,繼續:

    wget -c 'http://nodejs.org/dist/v0.8.16/node-v0.8.16.tar.gz' 
    tar zxvf node-v0.8.16.tar.gz
    cd node-v0.8.16
    ./configure
    make && make install

    又是一陣漫長的等待,搞不明白一個JS框架怎么要編譯這么久,無語!最后編譯完成測試一下:

    [root@localhost node-v0.8.16]# node -v v0.8.16

    OK,繼續Awestruct測試:

    [root@localhost kuuyee]# 下一代靜態網站生成工具 -i -f bootstrap 
    /usr/local/share/gems/gems/git-1.2.5/lib/git/lib.rb:700:in `command': git version 2>&1:sh: git: 未找到命令 (Git::GitExecuteError)
            from /usr/local/share/gems/gems/git-1.2.5/lib/git/lib.rb:649:in `current_command_version'
            from /usr/local/share/gems/gems/git-1.2.5/lib/git/lib.rb:659:in `meets_required_version?'
            from /usr/local/share/gems/gems/git-1.2.5/lib/git.rb:30:in `<top (required)>'
            from /usr/share/rubygems/rubygems/custom_require.rb:36:in `require'
            from /usr/share/rubygems/rubygems/custom_require.rb:36:in `require'
            from /usr/local/share/gems/gems/awestruct-0.4.7/lib/awestruct/deploy/base_deploy.rb:2:in `<top (required)>'
            from /usr/share/rubygems/rubygems/custom_require.rb:36:in `require'
            from /usr/share/rubygems/rubygems/custom_require.rb:36:in `require'
            from /usr/local/share/gems/gems/awestruct-0.4.7/lib/awestruct/deploy/s3_deploy.rb:1:in `<top (required)>'
            from /usr/share/rubygems/rubygems/custom_require.rb:36:in `require'
            from /usr/share/rubygems/rubygems/custom_require.rb:36:in `require'
            from /usr/local/share/gems/gems/awestruct-0.4.7/lib/awestruct/cli/deploy.rb:1:in `<top (required)>'
            from /usr/share/rubygems/rubygems/custom_require.rb:36:in `require'
            from /usr/share/rubygems/rubygems/custom_require.rb:36:in `require'
            from /usr/local/share/gems/gems/awestruct-0.4.7/lib/awestruct/cli/invoker.rb:7:in `<top (required)>'
            from /usr/share/rubygems/rubygems/custom_require.rb:36:in `require'
            from /usr/share/rubygems/rubygems/custom_require.rb:36:in `require'
            from /usr/local/share/gems/gems/awestruct-0.4.7/bin/awestruct:6:in `<top (required)>'
            from /usr/local/bin/awestruct:23:in `load'
            from /usr/local/bin/awestruct:23:in `<main>'

    竟然還TMD報錯,不過這回不用急,只是提示沒裝Git,好辦!那就裝唄:

    yum install git

    再繼續Awestruct:

    [root@localhost kuuyee.org]# 下一代靜態網站生成工具 -i -f bootstrap Create directory: /root/git_project/kuuyee.org/_config Create directory: /root/git_project/kuuyee.org/_layouts Create directory: /root/git_project/kuuyee.org/_ext Create file: /root/git_project/kuuyee.org/_ext/pipeline.rb Create directory: /root/git_project/kuuyee.org/stylesheets directory _site/stylesheets/ directory images/ directory javascripts/ create stylesheets/styles.scss create images/glyphicons-halflings.png create images/glyphicons-halflings-white.png create javascripts/bootstrap-alert.js create javascripts/bootstrap-button.js create javascripts/bootstrap-carousel.js create javascripts/bootstrap-collapse.js create javascripts/bootstrap-dropdown.js create javascripts/bootstrap-modal.js create javascripts/bootstrap-popover.js create javascripts/bootstrap-scrollspy.js create javascripts/bootstrap-tab.js create javascripts/bootstrap-tooltip.js create javascripts/bootstrap-transition.js create javascripts/bootstrap-typeahead.js create _site/stylesheets/styles.css Now you're 下一代靜態網站生成工具! To generate your site continuous during development, simply run: 下一代靜態網站生成工具 -d and visit your site at http://localhost:4242/ Create file: /root/git_project/kuuyee.org/_layouts/base.html.haml Create file: /root/git_project/kuuyee.org/index.html.haml

    Congratulations! 這回真的恭喜你了!趕緊部署一下:

    [root@localhost kuuyee]# 下一代靜態網站生成工具 -d Unable to locate profile: development Using profile: NONE Generating site: http://localhost:4242 Generating: /1003/awestruct-sample/_site/images/glyphicons-halflings-white.png Generating: /1003/awestruct-sample/_site/images/glyphicons-halflings.png Generating: /1003/awestruct-sample/_site/index.html Generating: /1003/awestruct-sample/_site/javascripts/bootstrap-alert.js /usr/local/share/gems/gems/awestruct-0.4.7/lib/awestruct/handlers/interpolation_handler.rb:35: Use RbConfig instead of obsolete and deprecated Config. Generating: /1003/awestruct-sample/_site/javascripts/bootstrap-button.js Generating: /1003/awestruct-sample/_site/javascripts/bootstrap-carousel.js Generating: /1003/awestruct-sample/_site/javascripts/bootstrap-collapse.js Generating: /1003/awestruct-sample/_site/javascripts/bootstrap-dropdown.js Generating: /1003/awestruct-sample/_site/javascripts/bootstrap-modal.js Generating: /1003/awestruct-sample/_site/javascripts/bootstrap-popover.js Generating: /1003/awestruct-sample/_site/javascripts/bootstrap-scrollspy.js Generating: /1003/awestruct-sample/_site/javascripts/bootstrap-tab.js Generating: /1003/awestruct-sample/_site/javascripts/bootstrap-tooltip.js Generating: /1003/awestruct-sample/_site/javascripts/bootstrap-transition.js Generating: /1003/awestruct-sample/_site/javascripts/bootstrap-typeahead.js Analyzing: /1003/awestruct-sample/_site/stylesheets/styles.css [Listen warning]: Missing dependency 'rb-inotify' (version '~> 0.8.8')! Please run the following to satisfy the dependency: gem install --version '~> 0.8.8' rb-inotify . For a better performance, it's recommended that you satisfy the missing dependency. Listen will be polling changes. Learn more at https://github.com/guard/listen#polling-fallback. . >> Thin web server (v1.4.1 codename Chromeo) >> Maximum connections set to 1024 >> Listening on 0.0.0.0:4242, CTRL+C to stop

    打開 http://localhost:4242/ 看看吧!

    BootStrap網站模板

    細心的童鞋一定會注意到部署輸出有警告,我是屬于不想看到任何警告的人,所以還得繼續,清楚警告:

    gem install --version '~> 0.8.8' rb-inotify

    再次部署訪問就不會有警告了!

    大功告成!祝愿各位童鞋安裝成功!

    posted on 2013-01-24 13:39 kuuyee 閱讀(2251) 評論(2)  編輯  收藏 所屬分類: LinuxGit/Maven 、系統管理Ruby/Python/Ceylon

    評論

    # re: 下一代靜態網站生成框架Awestruct在Fedora18安裝全過程 2013-01-24 20:06 免費網絡記事本

    用過 Jekyll ,可以制作一些簡單的網站,數據量如果不太大的話是一個很好的選擇。配合 github,連空間都省了,很好~  回復  更多評論   

    # re: 下一代靜態網站生成框架Awestruct在Fedora18安裝全過程 2013-01-24 21:10 將夜

    框架很重要  回復  更多評論   

    導航

    <2013年1月>
    303112345
    6789101112
    13141516171819
    20212223242526
    272829303112
    3456789

    統計

    隨筆分類(139)

    Linux內核

    搜索

    •  

    積分與排名

    • 積分 - 319517
    • 排名 - 177

    最新評論

    閱讀排行榜

    主站蜘蛛池模板: 国产成人人综合亚洲欧美丁香花 | 免费无码又爽又高潮视频| 久久亚洲免费视频| 久久国产乱子伦精品免费不卡| 亚洲人成在线播放网站| 久久九九久精品国产免费直播| 亚洲一区日韩高清中文字幕亚洲| 国产AV无码专区亚洲AV蜜芽 | 女人18毛片免费观看| 亚洲精品国产av成拍色拍| 女人18毛片a级毛片免费| 在线观看亚洲电影| 久久精品亚洲男人的天堂| 野花香高清视频在线观看免费| 亚洲ⅴ国产v天堂a无码二区| 24小时日本电影免费看| 亚洲伊人久久大香线焦| 国内自产拍自a免费毛片| 免费看内射乌克兰女| 亚洲一区二区三区无码中文字幕| 久久久久久免费一区二区三区| 亚洲精品午夜久久久伊人| 永久免费的网站在线观看| 亚洲1区2区3区精华液| 亚洲日本一区二区一本一道| 免费国产在线视频| 亚洲黄页网在线观看| 亚洲乱码中文字幕综合234 | A片在线免费观看| 亚洲综合色7777情网站777| 四虎永久免费地址在线观看| 久久久受www免费人成| 亚洲女人初试黑人巨高清| 国产在线观看免费完整版中文版 | 亚洲综合精品成人| 国外亚洲成AV人片在线观看| 四虎在线视频免费观看视频| 国产成人高清亚洲一区91| 亚洲av日韩av高潮潮喷无码| 午夜寂寞在线一级观看免费| 视频免费在线观看|