Hi all I''m running rails on apache with fcgi under windows I have a module which I''ve included in one of my models, but if I change any code in the module, i have to restart apache in order for the changes to take effect. i tried some suggestions from folks in the IRc channel, namely to put RAILS_ENV = ''development'' in environment.rb but that doesn''t make a difference. <%= RAILS_ENV %> displays ''development'' so I''m in development mode, I just can''t figure out why apache needs a restart for code changes to take effect. any suggestions? thanks alan
On 4/28/05, Alan Bullock <liststuff-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi all > > I''m running rails on apache with fcgi under windows > > I have a module which I''ve included in one of my models, but if I > change any code in the module, i have to restart apache in order for > the changes to take effect. i tried some suggestions from folks in > the IRc channel, namely to put RAILS_ENV = ''development'' in > environment.rb but that doesn''t make a difference. > > <%= RAILS_ENV %> displays ''development'' so I''m in development mode, I > just can''t figure out why apache needs a restart for code changes to > take effect. >it seems this isn''t a fastcgi issue after all. I created a blank rails project and ran it under webrick. The only configuration I changed was the database names. i set up a new model with an included module and the same thing happens. webrick has to be restarted in order for changes in the module code to take effect. help!
all it needed was a require_dependancy in my model. thanks to bitsweat and ulysses on IRc for their help
read here: http://www.rubygarden.org/ruby?FCGIRubyWhyArentMyChangesDisplayed [quote] this is exactly what fastcgi does - it caches scripts in memory (actually they are just in a loop doing nothing between requests - sleeping). that''s why it''s so fast. an extension of this is that, once a script is running, changing it''s source file will not cause the one in memory to change - a good thing really. [/quote] if you are in development mode,maybe you can turn off FCGI and just use CGI
and, changing database config really needs restart.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 hui wrote:> read here: > > http://www.rubygarden.org/ruby?FCGIRubyWhyArentMyChangesDisplayed > > [quote] > this is exactly what fastcgi does - it caches scripts in memory > (actually they are just in a loop doing nothing between requests - > sleeping). that''s why it''s so fast. an extension of this is that, once > a script is running, changing it''s source file will not cause the one > in memory to change - a good thing really. > [/quote] > > if you are in development mode,maybe you can turn off FCGI and just use CGIThat can''t be completely accurate. I''m using fastcgi with lighttpd, and it most certainly does see changes immediately. Plain CGI development is just too slow. The only time I have to restart the server is when I change things in the vendor tree for some rails patches I''m working on. http://wiki.rubyonrails.com/rails/show/RequireDependancy explains a little of how this is done.. However, the real question then is why isn''t it doing this for you if you are in development mode? - -- David Morton Maia Mailguard server side anti-spam/anti-virus solution: http://www.maiamailguard.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.5 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFCcaqoSIxC85HZHLMRAr9jAJ4vKArj06lmCdFcTDWiP7oKCKUDxwCfUE2o kpG1GKUC4SjtDTHVRn+hq14=a+fu -----END PGP SIGNATURE-----