安裝使用railscasts(Rails3)

railscasts.com是著名的Rails視頻播客網站,大概每週出一期節目。從2007年3月份至今已經出了270多集,作者Ryan Bates (rbates on Twitter and ryanb on GitHub)持之不懈的工作着實讓人欽佩。我也是陸陸續續看過一些,今日再次光顧railscasts.com網站,發現已經改版,令人欣喜的是其About介紹頁裏也提供了源代碼的鏈接,細看時發現已經升級到Rails3了,一時手癢決定安裝測試下。下面是安裝測試過程:

1、前提

RVM、Ruby1.9.2已經安裝。由於我的虛擬機在早前就已經安裝了Rails3的環境,此處也就略去了。需要的同學可搜索相關文章。

2、下載:使用git工具

代碼倉庫地址:https://github.com/ryanb/railscasts

$ cd projects

$ git clone https://github.com/ryanb/railscasts.git

3、安裝

3.1 生成配置文件,執行"script/setup"。

3.2 安裝項目依賴gem包:

首先安裝bundler,然後使用bundler自動安裝其它依賴包。

ubuntu@ip-10-48-111-136:~/projects/railscasts$ gem install bundler
Successfully installed bundler-1.0.15
1 gem installed

以下是完整的安裝日誌:

ubuntu@ip-10-48-111-136:~/projects/railscasts$ bundle install
Fetching git://github.com/rails/exception_notification.git
remote: Counting objects: 303, done.
remote: Compressing objects: 100% (174/174), done.
remote: Total 303 (delta 140), reused 234 (delta 105)
Receiving objects: 100% (303/303), 38.75 KiB, done.
Resolving deltas: 100% (140/140), done.
Fetching git://github.com/ryanb/cancan.git
remote: Counting objects: 2527, done.
remote: Compressing objects: 100% (1120/1120), done.
remote: Total 2527 (delta 1707), reused 2177 (delta 1380)
Receiving objects: 100% (2527/2527), 323.91 KiB, done.
Resolving deltas: 100% (1707/1707), done.
Fetching git://github.com/jnicklas/capybara.git
remote: Counting objects: 6685, done.
remote: Compressing objects: 100% (2657/2657), done.
remote: Total 6685 (delta 4481), reused 6103 (delta 3984)
Receiving objects: 100% (6685/6685), 5.75 MiB | 2.56 MiB/s, done.
Resolving deltas: 100% (4481/4481), done.
Fetching source index for http://rubygems.org/
Using rake (0.8.7)
Installing aaronh-chronic (0.3.9)
Installing abstract (1.0.0)
Installing activesupport (3.0.7)
Installing builder (2.1.2)
Installing i18n (0.5.0)
Installing activemodel (3.0.7)
Installing erubis (2.6.6)
Installing rack (1.2.2)
Installing rack-mount (0.6.14)
Installing rack-test (0.5.7)
Installing tzinfo (0.3.27)
Installing actionpack (3.0.7)
Installing mime-types (1.16)
Installing polyglot (0.3.1)
Installing treetop (1.4.9)
Installing mail (2.2.19)
Installing actionmailer (3.0.7)
Installing arel (2.0.9)
Installing activerecord (3.0.7)
Installing activeresource (3.0.7)
Installing acts_as_list (0.1.2)
Installing addressable (2.2.5)
Installing ancestry (1.2.3)
Using bundler (1.0.15)
Using cancan (1.6.3) from git://github.com/ryanb/cancan.git (at 2.0)
Installing highline (1.6.1)
Installing net-ssh (2.1.4)
Installing net-scp (1.0.4)
Installing net-sftp (2.0.5)
Installing net-ssh-gateway (1.1.0)
Installing capistrano (2.6.0)
Installing nokogiri (1.4.4) with native extensions
Installing ffi (1.0.7) with native extensions
Installing childprocess (0.1.8)
Installing json_pure (1.5.1)
Installing rubyzip (0.9.4)
Installing selenium-webdriver (0.1.4)
Installing xpath (0.1.3)
Using capybara (0.4.1.1) from git://github.com/jnicklas/capybara.git (at master)
Installing coderay (0.9.5)
Installing configuration (1.2.0)
Installing daemons (1.1.2)
Installing database_cleaner (0.6.7)
Installing diff-lcs (1.1.2)
Installing eventmachine (0.12.10) with native extensions
Using exception_notification (1.0.0) from git://github.com/rails/exception_notification.git (at master)
Installing factory_girl (1.3.2)
Installing thor (0.14.6)
Installing railties (3.0.7)
Installing rails (3.0.7)
Installing factory_girl_rails (1.0)
Installing fakeweb (1.3.0)
Installing multipart-post (1.1.0)
Installing faraday (0.6.1)
Installing guard (0.3.4)
Installing guard-rspec (0.3.1)
Installing jquery-rails (0.2.5)
Installing launchy (0.4.0)
Installing multi_json (0.0.5)
Installing mysql2 (0.2.6) with native extensions
Installing net-ldap (0.1.1)
Installing nifty-generators (0.4.2)
Installing oa-core (0.2.2)
Installing rest-client (1.6.1)
Installing oa-basic (0.2.2)
Installing pyu-ruby-sasl (0.0.3.2)
Installing rubyntlm (0.1.1)
Installing oa-enterprise (0.2.2)
Installing oa-more (0.2.2)
Installing oauth (0.4.4)
Installing oauth2 (0.3.0)
Installing oa-oauth (0.2.2)
Installing ruby-openid (2.1.8)
Installing rack-openid (1.2.0)
Installing ruby-openid-apps-discovery (1.2.0)
Installing oa-openid (0.2.2)
Installing omniauth (0.2.2)
Installing paper_trail (2.2.5)
Installing redcarpet (1.17.2) with native extensions
Installing riddle (1.2.1)
Installing rspec-core (2.6.3)
Installing rspec-expectations (2.6.0)
Installing rspec-mocks (2.6.0)
Installing rspec (2.6.0)
Installing rspec-rails (2.6.1)
Installing simplecov-html (0.4.4)
Installing simplecov (0.4.2)
Installing thin (1.2.11) with native extensions
Installing thinking-sphinx (2.0.1)
Installing whenever (0.6.2)
Installing will_paginate (3.0.pre2)
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.

4、配置

主要是修改config/database.yml文件中的數據庫用戶名與口令。

5、運行

獨立測試運行:rails s,然後通過瀏覽器訪問:http://<IP>:3000。正式使用時可在Apache2或nginx下通過passenger來部署運行。


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章