views:

21

answers:

2

Rails's script/server is just a few lines:

#!/usr/bin/env ruby
require File.expand_path('../../config/boot',  __FILE__)
require 'commands/server'

I wonder where the server file is? I tried a

find . -name 'server.*' 
find . -name 'server' 

but can't find it

+3  A: 

It should be under your Rails gem directory, in lib/commands. On my machine:

/opt/ruby-1.8.7-p302/lib/ruby/gems/1.8/gems/rails-2.3.8/lib/commands/server.rb
Chris Heald
thanks... please see my other answer, in the case of a Mac
動靜能量
A: 

thanks. in the case of a Mac, I found that they are on

/Library/Ruby/Gems/1.8/gems/rails-2.3.5/lib/commands/server.rb
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/commands/server.rb
/Users/peter/.gem/ruby/1.8/gems/rails-2.3.5/lib/commands/server.rb

the following are there but doesn't have my Rails 2.3.5 version:

/Developer/SDKs/MacOSX10.6.sdk/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/rails-1.2.6/lib/commands/server.rb       
/Developer/SDKs/MacOSX10.6.sdk/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/commands/server.rb

Update: Now the question is: which of the above 3 is the one? How can you tell easily?

動靜能量
This is only if you are using the version of Rails that comes bundled with the machine. Basically, it's what Chris said above, it will be in the `lib/commands` directory of whichever Rails gem is being used in the project.
theIV
Also, it's probably in the System Ruby framework (`/System/Library/Frameworks/Ruby.framework`).
mipadi