2012-08-02 82 views

回答

0

應用程序運行on Rails的流動這裏找到關鍵信息。

..] $ rails s

後臺進程

{

..config/boot.rb 

    installing the file Gemfile (in root dir of appilcation) 

    ..config/application.rb 

}

[服務器靴這裏/終端中示出]

=> Booting WEBrick 

=> Rails 3.2.6 application starting in development on http://0.0.0.0:3000 

=> Call with -d to detach 

=> Ctrl-C to shutdown server 

後臺進程

{

..config.ru 

..config/environment.rb 

..config/environment/development.rb 

..config/initializer/*.* 

..config/routes.rb 

}

[服務器從這裏開始/終端中示出]

> INFO WEBrick 1.3.1 
> INFO ruby 1.9.3 ('Date') [i686-linux] 
> INFO WEBrick::HTTPServer#start: pid=3031 port=3000 
0

類型which rails會給你答案。

然後打開該文件,這是這樣的:

#!/usr/bin/env ruby1.9.1 
# 
# This file was generated by RubyGems. 
# 
# The application 'railties' is installed as part of a gem, and 
# this file is here to facilitate running it. 
# 

require 'rubygems' 

version = ">= 0" 

if ARGV.first =~ /^_(.*)_$/ and Gem::Version.correct? $1 then 
    version = $1 
    ARGV.shift 
end 

gem 'railties', version 
load Gem.bin_path('railties', 'rails', version) 
+0

這是非常有用的。謝謝。但我需要知道應用程序項目的啓動。 – 2012-08-02 06:07:26

1

執行的第一應用文件通常將config/boot.rb

然後config/environment.rb,其典型地將加載文件中的一個在config/environments/(哪個文件運行,將取決於已設置的環境。

然後config/application.rb將得到執行

此後,config/routes.rb會給服務器的有關如何處理傳入的請求

+1

好的回答夥計。非常感謝。 – 2012-08-03 04:03:52

相關問題