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

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

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

    簡易語言

    數字溝通

     

    安裝rails(ruby on rails)

      記得兩年前使用ror做網站,自動生成功能記憶猶新,只是當時網絡知識實在缺乏,體會不到其中的樂趣。現在了解的很多了,書也有兩本,一直想重新體驗最新版做個網站。安裝這個過程實在有點坑爹,查找網上若干ror的書包括2012年版的書,按照上面的步驟都沒法安裝完成,搞得我一會在linux下試驗,一會在windows下試驗,都沒成功,只好放下。時間花不少,很不爽的體驗。

      好在,過了一段時間,忽然想看看ruby的那兩本書,然后就愛上這個語言了。于是做一些想做的試驗,一些試驗需要做些配置,對安裝目錄也就了解了。下載一些插件居然自己跑到了ruby的下載頁。看到上面居然一個版本有3樣要下的,幫助文件和安裝文件不就夠了嗎。還要一個mingw做工具么?這個不是有自己的官網下載么。也沒管。想起ruby目錄下include中有i386-mingw32,才聯系起來。應該是以mingw做make工具的。rails應該需要make,因為每次安裝都拋出make出錯信息。雖然有mingw官網,但這里應該是做成自己的插件。于是到下載頁http://rubyforge.org/frs/?group_id=167下載相應版本的mingw32工具解壓覆蓋到安裝目錄中,要是怕出問題先對目錄做備份

      另外下載不了的都cross wall下載


    C:\Documents and Settings\Administrator>gem install rails
    ERROR:  Error installing rails:
            The 'json' native gem requires installed build tools.

    Please update your PATH to include build tools or download the DevKit
    from 'http://rubyinstaller.org/downloads' and follow the instructions
    at 'http://github.com/oneclick/rubyinstaller/wiki/Development-Kit'

      還有錯,但明顯不是曾經報的make錯誤了。
      按照網址下載和遵從上面的方法安裝即可(下面的命令即是按照安裝方法安裝的)
      其中config.yml文件僅僅描述ruby所在路徑,修改成你的ruby路徑即可

    D:\>cd D:\Ruby192\devkit

    D:\Ruby192\devkit>ruby dk.rb init
    [INFO] found RubyInstaller v1.9.2 at D:/Ruby192

    Initialization complete! Please review and modify the auto-generated
    'config.yml' file to ensure it contains the root directories to all
    of the installed Rubies you want enhanced by the DevKit.

    D:\Ruby192\devkit>ruby dk.rb review
    Based upon the settings in the 'config.yml' file generated
    from running 'ruby dk.rb init' and any of your customizations,
    DevKit functionality will be injected into the following Rubies
    when you run 'ruby dk.rb install'.

    D:/Ruby192

    D:\Ruby192\devkit>ruby dk.rb install
    [INFO] Updating convenience notice gem override for 'D:/Ruby192'
    [INFO] Installing 'D:/Ruby192/lib/ruby/site_ruby/devkit.rb'

    D:\Ruby192\devkit>gem install rdiscount --platform=ruby
    Fetching: rdiscount-1.6.8.gem (100%)
    Temporarily enhancing PATH to include DevKit...
    Building native extensions.  This could take a while...
    Successfully installed rdiscount-1.6.8
    1 gem installed
    Installing ri documentation for rdiscount-1.6.8...
    Installing RDoc documentation for rdiscount-1.6.8...

    D:\Ruby192\devkit>ruby -rubygems -e "require 'rdiscount'; puts RDiscount.new('**
    Hello RubyInstaller**').to_html"
    <p><strong>Hello RubyInstaller</strong></p>

    下面安裝rails

    D:\Ruby192\devkit>gem install rails
    Temporarily enhancing PATH to include DevKit...
    Building native extensions.  This could take a while...
    Fetching: rdoc-3.12.gem (100%)
    Depending on your version of ruby, you may need to install ruby rdoc/ri data:

    <= 1.8.6 : unsupported
     = 1.8.7 : gem install rdoc-data; rdoc-data --install
     = 1.9.1 : gem install rdoc-data; rdoc-data --install
    >= 1.9.2 : nothing to do! Yay!
    Fetching: railties-3.2.8.gem (100%)
    Fetching: bundler-1.2.0.gem (100%)
    Fetching: rails-3.2.8.gem (100%)
    Successfully installed json-1.7.5
    Successfully installed rdoc-3.12
    Successfully installed railties-3.2.8
    Successfully installed bundler-1.2.0
    Successfully installed rails-3.2.8
    5 gems installed
    Installing ri documentation for json-1.7.5...
    Installing ri documentation for rdoc-3.12...
    unable to convert U+00A9 from UTF-8 to GBK for lib/rdoc/text.rb, skipping
    Installing ri documentation for railties-3.2.8...
    Installing ri documentation for bundler-1.2.0...
    Installing ri documentation for rails-3.2.8...
    Installing RDoc documentation for json-1.7.5...
    Installing RDoc documentation for rdoc-3.12...
    unable to convert U+00A9 from UTF-8 to GBK for lib/rdoc/text.rb, skipping
    Installing RDoc documentation for railties-3.2.8...
    Installing RDoc documentation for bundler-1.2.0...
    Installing RDoc documentation for rails-3.2.8...

      果然成功了,哈哈

    D:\Ruby192\devkit>rails -v
    Rails 3.2.8

      想做個實例,搜一下網上的書,還是不行,那些書最新的2012的都不用命令行做,2011的還是老的命令行方式。根本沒法用,上官網看就是了。
    D:\Ruby192\devkit>rails new D:/project/ruby/railsapp
          create
          create  README.rdoc
          create  Rakefile
          create  config.ru
          create  .gitignore
          create  Gemfile
          create  app
          create  app/assets/images/rails.png
          create  app/assets/javascripts/application.js
          create  app/assets/stylesheets/application.css
          create  app/controllers/application_controller.rb
          create  app/helpers/application_helper.rb
          create  app/mailers
          create  app/models
          create  app/views/layouts/application.html.erb
          create  app/mailers/.gitkeep
          create  app/models/.gitkeep
          create  config
          create  config/routes.rb
          create  config/application.rb
          create  config/environment.rb
          create  config/environments
          create  config/environments/development.rb
          create  config/environments/production.rb
          create  config/environments/test.rb
          create  config/initializers
          create  config/initializers/backtrace_silencers.rb
          create  config/initializers/inflections.rb
          create  config/initializers/mime_types.rb
          create  config/initializers/secret_token.rb
          create  config/initializers/session_store.rb
          create  config/initializers/wrap_parameters.rb
          create  config/locales
          create  config/locales/en.yml
          create  config/boot.rb
          create  config/database.yml
          create  db
          create  db/seeds.rb
          create  doc
          create  doc/README_FOR_APP
          create  lib
          create  lib/tasks
          create  lib/tasks/.gitkeep
          create  lib/assets
          create  lib/assets/.gitkeep
          create  log
          create  log/.gitkeep
          create  public
          create  public/404.html
          create  public/422.html
          create  public/500.html
          create  public/favicon.ico
          create  public/index.html
          create  public/robots.txt
          create  script
          create  script/rails
          create  test/fixtures
          create  test/fixtures/.gitkeep
          create  test/functional
          create  test/functional/.gitkeep
          create  test/integration
          create  test/integration/.gitkeep
          create  test/unit
          create  test/unit/.gitkeep
          create  test/performance/browsing_test.rb
          create  test/test_helper.rb
          create  tmp/cache
          create  tmp/cache/assets
          create  vendor/assets/javascripts
          create  vendor/assets/javascripts/.gitkeep
          create  vendor/assets/stylesheets
          create  vendor/assets/stylesheets/.gitkeep
          create  vendor/plugins
          create  vendor/plugins/.gitkeep
             run  bundle install
    Fetching gem metadata from https://rubygems.org/.........
    Installing rake (0.9.2.2)
    Installing i18n (0.6.1)
    Installing multi_json (1.3.6)
    Using activesupport (3.2.8)
    Using builder (3.0.0)
    Using activemodel (3.2.8)
    Using erubis (2.7.0)
    Using journey (1.0.4)
    Using rack (1.4.1)
    Using rack-cache (1.2)
    Using rack-test (0.6.1)
    Using hike (1.2.1)
    Using tilt (1.3.3)
    Using sprockets (2.1.3)
    Using sprockets (2.1.3)
    Using actionpack (3.2.8)
    Installing mime-types (1.19)
    Using polyglot (0.3.3)
    Using treetop (1.4.10)
    Using mail (2.4.4)
    Using actionmailer (3.2.8)
    Using arel (3.0.2)
    Using tzinfo (0.3.33)
    Using activerecord (3.2.8)
    Using activeresource (3.2.8)
    Using bundler (1.2.0)
    Installing coffee-script-source (1.3.3)
    Installing execjs (1.4.0)
    Installing coffee-script (2.2.0)
    Using rack-ssl (1.3.2)
    Using json (1.7.5)
    Using rdoc (3.12)
    Installing thor (0.16.0)
    Using railties (3.2.8)
    Installing coffee-rails (3.2.2)
    Installing jquery-rails (2.1.1)
    Using rails (3.2.8)
    Installing sass (3.2.1)
    Installing sass-rails (3.2.5)
    Using sqlite3 (1.3.6)
    Installing uglifier (1.2.7)
    Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem
    is installed.

    D:\Ruby192\devkit>cd D:\project\ruby\railsapp

    D:\project\ruby\railsapp>rails server
    => Booting WEBrick
    => Rails 3.2.8 application starting in development on http://0.0.0.0:3000
    => Call with -d to detach
    => Ctrl-C to shutdown server
    [2012-09-01 06:44:40] INFO  WEBrick 1.3.1
    [2012-09-01 06:44:41] INFO  ruby 1.9.2 (2011-07-09) [i386-mingw32]
    [2012-09-01 06:44:41] INFO  WEBrick::HTTPServer#start: pid=2924 port=3000

      瀏覽器中輸入http://localhost:3000/,熟悉的界面出現


      所以ror厚厚的書讀完也沒用,可能動手連代碼都沒機會敲。

      另外也可以到網站http://railsinstaller.org/下載配置好的安裝包,就免去手動配置啦。


    一種更好的態度,更好的學習、思維方式。它會是網絡極佳的生存方式,你喜歡就對。

    posted on 2012-09-02 01:17 yangyusong 閱讀(4676) 評論(0)  編輯  收藏


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


    網站導航:
     

    導航

    統計

    常用鏈接

    留言簿(3)

    隨筆分類

    隨筆檔案

    文章分類

    搜索

    最新評論

    閱讀排行榜

    評論排行榜

    主站蜘蛛池模板: 最近2019中文字幕免费看最新| 免费成人在线电影| 免费电视剧在线观看| 亚洲男人天堂影院| 99久久精品日本一区二区免费| 久久国产亚洲精品无码| 久久久久久国产精品免费免费男同 | 免费又黄又硬又爽大片| 国产精品亚洲小说专区| xvideos亚洲永久网址| xvideos永久免费入口| 亚洲精品无码MV在线观看| 日本一区午夜艳熟免费| 久久亚洲AV成人无码软件 | 妞干网手机免费视频| 亚洲欧洲国产综合AV无码久久| 国产免费怕怕免费视频观看| 国产亚洲福利精品一区二区| 久久久久亚洲av毛片大| 国产免费阿v精品视频网址| 亚洲白色白色在线播放| 午夜神器成在线人成在线人免费| 国产亚洲精彩视频| 日韩一卡2卡3卡4卡新区亚洲 | 91短视频在线免费观看| 亚洲国产成人精品激情| 国产乱子伦片免费观看中字| 美女网站在线观看视频免费的| 久久国产亚洲观看| 在线免费观看污网站| 一个人看的www在线免费视频| 久久亚洲精品视频| 免费av欧美国产在钱| 一区免费在线观看| 老汉色老汉首页a亚洲| 国产高清免费在线| 毛片无码免费无码播放| 亚洲成a∧人片在线观看无码| 亚洲色大成网站www永久一区| 欧美a级在线现免费观看| 一级人做人爰a全过程免费视频|