Forum: Ruby on Rails Understanding Rails Internals (i.e. files generated by the r

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
0cfed8578fdd30c896da1e810bd34df9?d=identicon&s=25 virgild (Guest)
on 2005-11-13 19:54
(Received via mailing list)
Hi. I'm trying to understand the files generated by the 'rails' command.
I
get the controller/model/view files, but get confused about what the
environment, boot, and dispatch files do.

Also, which of these files are dependent on the OS as I develop in
WinXP/MySQL for win/webrick and the production server will be a
Linux/Apache
box.

Thanks.
Vurg
(From ASP.NET to RoR)
E37ca8b3eee534fa6781f7ba13743afb?d=identicon&s=25 ryan.wood (Guest)
on 2005-11-14 05:45
(Received via mailing list)
Hey Vurg. I'm also as ASP.NET -> Rails guys. First off, I'd recommend
getting subversion and checking out the Rails source. It's always
clearer when you can go right to the code and see what's going on...at
least for Rails internals.

boot.rb just sets up things up (calls the initializer.rb see source,
sets up the environment, etc.) You most likely won't have to mess with
this one.

environment.rb is what sets the setting for your app. Here is where
you configure the enviroment (if not using server environment
variables), load paths, and any custom settings. Think of it as
similar to the web.config, but it's code rather than XML.

The dispatch.* files are what runs your rails app.

dispatch.rb - used for webrick (pure ruby dev web server)
dispatch.cgi - used for CGI with Apache/LightTPD
dispatch.fcgi - used for FastCGI with Apache/LightTPD

The shebang (first line with the #!) will be specific to the
environment. It is the path to the Ruby exe. For example:

In windows - #!c:\ruby\bin\ruby
In *nix - #!/user/local/bin/ruby

Everything else (with the potential exception of the Win/Linux end of
line issue) should work in both environments.

Hope that helps. And to all the rails gurus -- please correct me if
I'm wrong. This is just off the top of my head.

--Ryan
0cfed8578fdd30c896da1e810bd34df9?d=identicon&s=25 virgild (Guest)
on 2005-11-14 15:22
(Received via mailing list)
Thanks Ryan, that seems like the right direction. I'll go check the
source.

"Ryan Wood" <ryan.wood@gmail.com> wrote in
message
news:c2c6b4d80511132044w15326972r6e00fcec9469a2be@mail.gmail.com...
Hey Vurg. I'm also as ASP.NET -> Rails guys. First off, I'd recommend
getting subversion and checking out the Rails source. It's always
clearer when you can go right to the code and see what's going on...at
least for Rails internals.

boot.rb just sets up things up (calls the initializer.rb see source,
sets up the environment, etc.) You most likely won't have to mess with
this one.

environment.rb is what sets the setting for your app. Here is where
you configure the enviroment (if not using server environment
variables), load paths, and any custom settings. Think of it as
similar to the web.config, but it's code rather than XML.

The dispatch.* files are what runs your rails app.

dispatch.rb - used for webrick (pure ruby dev web server)
dispatch.cgi - used for CGI with Apache/LightTPD
dispatch.fcgi - used for FastCGI with Apache/LightTPD

The shebang (first line with the #!) will be specific to the
environment. It is the path to the Ruby exe. For example:

In windows - #!c:\ruby\bin\ruby
In *nix - #!/user/local/bin/ruby

Everything else (with the potential exception of the Win/Linux end of
line issue) should work in both environments.

Hope that helps. And to all the rails gurus -- please correct me if
I'm wrong. This is just off the top of my head.

--Ryan
4c3511a439ed90fa012a55928a60e230?d=identicon&s=25 curt.hibbs (Guest)
on 2005-11-14 15:50
(Received via mailing list)
You can also find the rails source code that RubyGems installed on your
system by looking at:

.../ruby/lib/ruby/gems/1.8/gems/...

(hopefully I got that right... did it from memory)

Curt
0cfed8578fdd30c896da1e810bd34df9?d=identicon&s=25 virgild (Guest)
on 2005-11-14 17:08
(Received via mailing list)
Yup, they're there. Thanks Curt.

Vurg
-------------------

"Curt Hibbs" <curt.hibbs@gmail.com> wrote in
message
news:31d15f490511140647n56d56217nc921c5b0513e841f@mail.gmail.com...
You can also find the rails source code that RubyGems installed on your
system by looking at:

   .../ruby/lib/ruby/gems/1.8/gems/...

(hopefully I got that right... did it from memory)

Curt


On 11/14/05, Vurg <virgild@gmail.com> wrote:
Thanks Ryan, that seems like the right direction. I'll go check the
source.

"Ryan Wood" <ryan.wood@gmail.com> wrote in
message
news:c2c6b4d80511132044w15326972r6e00fcec9469a2be@mail.gmail.com
...
Hey Vurg. I'm also as ASP.NET -> Rails guys. First off, I'd recommend
getting subversion and checking out the Rails source. It's always
clearer when you can go right to the code and see what's going on...at
least for Rails internals.

boot.rb just sets up things up (calls the initializer.rb see source,
sets up the environment, etc.) You most likely won't have to mess with
this one.

environment.rb is what sets the setting for your app. Here is where
you configure the enviroment (if not using server environment
variables), load paths, and any custom settings. Think of it as
similar to the web.config, but it's code rather than XML.

The dispatch.* files are what runs your rails app.

dispatch.rb - used for webrick (pure ruby dev web server)
dispatch.cgi - used for CGI with Apache/LightTPD
dispatch.fcgi - used for FastCGI with Apache/LightTPD

The shebang (first line with the #!) will be specific to the
environment. It is the path to the Ruby exe. For example:

In windows - #!c:\ruby\bin\ruby
In *nix - #!/user/local/bin/ruby

Everything else (with the potential exception of the Win/Linux end of
line issue) should work in both environments.

Hope that helps. And to all the rails gurus -- please correct me if
I'm wrong. This is just off the top of my head.

--Ryan

On 11/13/05, Vurg <virgild@gmail.com > wrote:
> Vurg
> (From ASP.NET to RoR)
>
>
>
>
> _______________________________________________
> Rails mailing list
> Rails@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>



_______________________________________________
Rails mailing list
Rails@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails






_______________________________________________
Rails mailing list
Rails@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails
This topic is locked and can not be replied to.