Vurg
2005-Nov-13 18:41 UTC
Understanding Rails Internals (i.e. files generated by the rails command)
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)
Ryan Wood
2005-Nov-14 04:44 UTC
Re: Understanding Rails Internals (i.e. files generated by the rails command)
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-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> 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) > > > > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
Vurg
2005-Nov-14 14:16 UTC
Re: Understanding Rails Internals (i.e. files generated bythe rails command)
Thanks Ryan, that seems like the right direction. I''ll go check the source. "Ryan Wood" <ryan.wood-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote in message news:c2c6b4d80511132044w15326972r6e00fcec9469a2be-JsoAwUIsXouq+1Nelnf3ueG/Ez6ZCGd0@public.gmane.org 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-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> 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) > > > > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
Curt Hibbs
2005-Nov-14 14:47 UTC
Re: Re: Understanding Rails Internals (i.e. files generated bythe rails command)
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-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Thanks Ryan, that seems like the right direction. I''ll go check the > source. > > "Ryan Wood" <ryan.wood-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote in > message news:c2c6b4d80511132044w15326972r6e00fcec9469a2be-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org > ... > Hey Vurg. I''m also as ASP.NET <http://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-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > 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 <http://ASP.NET> to RoR) > > > > > > > > > > _______________________________________________ > > Rails mailing list > > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >_______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Vurg
2005-Nov-14 15:58 UTC
Re: Re: Understanding Rails Internals (i.e. files generatedbythe rails command)
Yup, they''re there. Thanks Curt. Vurg ------------------- "Curt Hibbs" <curt.hibbs-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote in message news:31d15f490511140647n56d56217nc921c5b0513e841f-JsoAwUIsXouq+1Nelnf3ueG/Ez6ZCGd0@public.gmane.org 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-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: Thanks Ryan, that seems like the right direction. I''ll go check the source. "Ryan Wood" <ryan.wood-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote in message news:c2c6b4d80511132044w15326972r6e00fcec9469a2be-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org ... 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-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org > wrote:> 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) > > > > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >_______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails