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

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

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

    下一代靜態(tài)網(wǎng)站生成框架Awestruct在Fedora18安裝全過程

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

    安裝Ruby環(huán)境

    首先安裝一些依賴庫,否則安裝Awestruct會報(bào)如下的錯(cuò)誤:

    Building native extensions.  This could take a while... 
    .........
    ERROR: Error installing 下一代靜態(tài)網(wǎng)站生成工具:
            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 執(zhí)行如下命令:

    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的粉絲,對不住用其它發(fā)行版的童鞋了,請自行根據(jù)我列出的安裝包找到對應(yīng)的系統(tǒng)安裝方法。

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

    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 執(zhí)行如下命令:

    gem install 下一代靜態(tài)網(wǎng)站生成工具 --no-ri --no-rdoc

    結(jié)果報(bào)如下錯(cuò)誤:

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

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

    yum install -y rubygem-nokogiri

    再次安裝Awestruct:

    yum install -y rubygem-nokogiri

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

    Successfully installed 下一代靜態(tài)網(wǎng)站生成工具-0.4.7 17 gems installed

    不過別高興太早,先適用下是否OK!用BootStrap模板生產(chǎn)一個(gè)新的靜態(tài)網(wǎng)站,命令如下:

    下一代靜態(tài)網(wǎng)站生成工具 -i -f bootstrap //或者用awestruct --init --framework bootstrap

    傻眼了,還是報(bào)錯(cuò):

    [root@localhost kuuyee]# 下一代靜態(tài)網(wǎng)站生成工具 -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。繼續(xù)Google,最后一位高人指點(diǎn)說裝個(gè)JavaScript引擎就OK,我選擇NodeJS。只可惜NodeJSF沒有YUM源,只能源碼編譯安裝,無所謂,繼續(xù):

    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

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

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

    OK,繼續(xù)Awestruct測試:

    [root@localhost kuuyee]# 下一代靜態(tài)網(wǎng)站生成工具 -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報(bào)錯(cuò),不過這回不用急,只是提示沒裝Git,好辦!那就裝唄:

    yum install git

    再繼續(xù)Awestruct:

    [root@localhost kuuyee.org]# 下一代靜態(tài)網(wǎng)站生成工具 -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 下一代靜態(tài)網(wǎng)站生成工具! To generate your site continuous during development, simply run: 下一代靜態(tài)網(wǎng)站生成工具 -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]# 下一代靜態(tài)網(wǎng)站生成工具 -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網(wǎng)站模板

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

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

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

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

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

    評論

    # re: 下一代靜態(tài)網(wǎng)站生成框架Awestruct在Fedora18安裝全過程 2013-01-24 20:06 免費(fèi)網(wǎng)絡(luò)記事本

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

    # re: 下一代靜態(tài)網(wǎng)站生成框架Awestruct在Fedora18安裝全過程 2013-01-24 21:10 將夜

    框架很重要  回復(fù)  更多評論   

    導(dǎo)航

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

    統(tǒng)計(jì)

    隨筆分類(139)

    Linux內(nèi)核

    搜索

    •  

    積分與排名

    • 積分 - 319471
    • 排名 - 177

    最新評論

    閱讀排行榜

    主站蜘蛛池模板: 亚洲av乱码一区二区三区| 精品国产日韩亚洲一区在线| 成年人性生活免费视频| 免费看又黄又爽又猛的视频软件 | 亚洲精品无码久久久久去q| 四虎国产成人永久精品免费| 亚洲乱色伦图片区小说| 亚洲日韩精品无码专区网址| 在线观看av永久免费| 久久国产美女免费观看精品| 亚洲女人18毛片水真多| 亚洲高清偷拍一区二区三区| 永久免费在线观看视频| 国产日韩久久免费影院| 亚洲一久久久久久久久| 亚洲精品国产精品乱码不99| 日韩成全视频观看免费观看高清| 免费无码一区二区三区蜜桃| 亚洲AV永久无码天堂影院| 亚洲AV人无码激艳猛片| 四虎免费久久影院| 成人黄色免费网址| 成人性生交大片免费看中文| www亚洲精品久久久乳| 91亚洲国产成人久久精品| 亚洲精品高清无码视频| 亚洲av日韩片在线观看| 成年网在线观看免费观看网址| 亚洲精品国产成人| 亚洲精品国产美女久久久| 亚洲一级黄色视频| 国产美女无遮挡免费网站| 美女视频黄的全免费视频| 91香焦国产线观看看免费| 中文字幕在线成人免费看| 色吊丝免费观看网站| 亚洲乱色熟女一区二区三区蜜臀| 亚洲午夜精品在线| 亚洲高清无在码在线电影不卡| 亚洲午夜无码久久久久| 亚洲日韩VA无码中文字幕|