ROR自學摘要(一)

以下代表我測試的過程心得,最後並沒有成功,我的環境是windows server 2003...。
DC:代表DOS command任何路徑上輸入指令...

1.ruby有安裝成功嗎?

DC:ruby -v

-->Ruby 1.8.6
如果有看到ruby 1.8.6就是成功了

2.安裝Rails框架

DC:gem install rails --include-dependencies

因為會從網路上下載相關檔案,過程會持續幾分鐘。完畢後檢查Rails版本
DC:Rails -v
-->Rails 2.3.2

3.安裝Mongrel(ROR 應用伺服器)

DC:gem install mongrel --include-dependencies

接下來會看到下列的選單。因為我的環境是Windows Server2003 ,所以我挑選3。
-->

Select which gem to install for your platform (i386-mswin32)
1. mongrel 1.1.5 (ruby)
2. mongrel 1.1.5 (x86-mingw32)
3. mongrel 1.1.5 (x86-mswin32-60)
4. mongrel 1.1.5 (java)
5. Skip this gem
6. Cancel installation
> 3

接著會下載一些檔案回來...

Successfully installed mongrel-1.1.5-x86-mswin32-60
Successfully installed gem_plugin-0.2.3
Successfully installed cgi_multipart_eof_fix-2.5.0
Installing ri documentation for mongrel-1.1.5-x86-mswin32-60...
Installing ri documentation for gem_plugin-0.2.3...
Installing ri documentation for cgi_multipart_eof_fix-2.5.0...
Installing RDoc documentation for mongrel-1.1.5-x86-mswin32-60...
Installing RDoc documentation for gem_plugin-0.2.3...
Installing RDoc documentation for cgi_multipart_eof_fix-2.5.0...


4.安裝Mongrel Plugin

DC:gem install mongrel_service --include-dependencies

-->

Select which gem to install for your platform (i386-mswin32)
1. mongrel_service 0.3.4 (i386-mswin32)
2. mongrel_service 0.3.3 (mswin32)
3. mongrel_service 0.3.2 (mswin32)
4. mongrel_service 0.3.1 (mswin32)
5. Skip this gem
6. Cancel installation
> 1
Select which gem to install for your platform (i386-mswin32)
1. win32-service 0.5.2 (mswin32)
2. win32-service 0.5.2 (ruby)
3. Skip this gem
4. Cancel installation
> 1
Successfully installed mongrel_service-0.3.4-i386-mswin32
Successfully installed win32-service-0.5.2-mswin32
Installing ri documentation for mongrel_service-0.3.4-i386-mswin32...
Installing ri documentation for win32-service-0.5.2-mswin32...
Installing RDoc documentation for mongrel_service-0.3.4-i386-mswin32...
Installing RDoc documentation for win32-service-0.5.2-mswin32...


5.建立專案資料夾

DC:rails -d mysql C:\www

-->


create
create app/controllers
create app/helpers
create app/models
create app/views/layouts
create config/environments
create config/initializers
create config/locales
create db
create doc
create lib
create lib/tasks
create log
create public/images
create public/javascripts
create public/stylesheets
create script/performance
create test/fixtures
create test/functional
create test/integration
create test/performance
create test/unit
create vendor
create vendor/plugins
create tmp/sessions
create tmp/sockets
create tmp/cache
create tmp/pids
create Rakefile
create README
create app/controllers/application_controller.rb
create app/helpers/application_helper.rb
create config/database.yml
create config/routes.rb
create config/locales/en.yml
create config/initializers/backtrace_silencers.rb
create config/initializers/inflections.rb
create config/initializers/mime_types.rb
create config/initializers/new_rails_defaults.rb
create config/initializers/session_store.rb
create config/environment.rb
create config/boot.rb
create config/environments/production.rb
create config/environments/development.rb
create config/environments/test.rb
create script/about
create script/console
create script/dbconsole
create script/destroy
create script/generate
create script/runner
create script/server
create script/plugin
create script/performance/benchmarker
create script/performance/profiler
create test/test_helper.rb
create test/performance/browsing_test.rb
create public/404.html
create public/422.html
create public/500.html
create public/index.html
create public/favicon.ico
create public/robots.txt
create public/images/rails.png
create public/javascripts/prototype.js
create public/javascripts/effects.js
create public/javascripts/dragdrop.js
create public/javascripts/controls.js
create public/javascripts/application.js
create doc/README_FOR_APP
create log/server.log
create log/production.log
create log/development.log
create log/test.log



該指令會建立完整的Rails完整目錄、程式碼架構。

6.將Mongrel Service安裝為windows 服務

DC:mongrel_rails service::install -N Mongrel -c C:\www -p 81 -e production

-->不過後來這邊就失敗了,侯來還是在"服務"中,自己手動調成"自動模式"。