I''m currently using rails 0.12.1 on Mac OS X (with Apache+FCGI). I''ve been randomly getting "<h2>Application error</h2>Rails application failed to start properly" errors whenever I try to access the application I''ve been developing. If I hit reload a couple of times, the error goes away and the app behaves as it should. This seems to happen only when I first start work, almost as if the app is an ancient Chevy that doesn''t want to roll over. Anybody else have this trouble? Cheers, J.D.
On 27-apr-05, at 15:04, J.D. Hollis wrote:> I''m currently using rails 0.12.1 on Mac OS X (with Apache+FCGI). I''ve > been randomly getting "<h2>Application error</h2>Rails application > failed to start properly" errors whenever I try to access the > application I''ve been developing. If I hit reload a couple of times, > the error goes away and the app behaves as it should. This seems to > happen only when I first start work, almost as if the app is an > ancient Chevy that doesn''t want to roll over. Anybody else have this > trouble? >In the default configuration Apache starts Ruby only when you hit the Rails app with a request. This startup might take some time, because it actually starts 5-6 ruby interpreters. So it is pretty possible that when you hit your page after restarting Apache the request times out because the ruby instances did not start quickly enough. On the next refresh it should work well, though. You can solve this by configuring FCGI in httpd.conf to actually start your rubies as soon as Apache is restarted. You also should check your error_log for any messages. And I also had this problem with the new .htaccess that I got from rails 0.12 (related to too many redirections with mod_rewrite) - when I replaced it with the old one the problem went away. -- Julian "Julik" Tarkhanov
Hi J.D. I''ve got the exact same problem, and posted about it a while back (search for my name in the archives). I got some helpful advice (Thanks Robert and Zack!) and I''ve narrowed it down to a couple of things. I''m pretty sure it has to do with either the /tmp/fcgi_ipc directory or the /tmp/ruby_sess.* files or both. If you remove the /tmp/fcgi_ipc directory (as the Mac OS X default cron processes do) then the 500 error appears, and I have to restart apache to recover. If there are stale ruby_sess.* files in /tmp, then the 500 error appears, but reloading will recover the app. Robert suggested adding a ''-restart'' flag to the FastCgiConfig in the mod_fastcgi module section in httpd.conf. I did that, but it didn''t seem to solve my problem - YMMV. Zack suggested moving the fcgi_ipc directory out of /tmp so it doesn''t get periodically clobbered - which I haven''t yet done, but am probably going to try soon. Hope this helps, Let me know if you have any further insight, Ryan On 4/27/05, J.D. Hollis <cowboysolitude-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I''m currently using rails 0.12.1 on Mac OS X (with Apache+FCGI). I''ve > been randomly getting "<h2>Application error</h2>Rails application > failed to start properly" errors whenever I try to access the > application I''ve been developing. If I hit reload a couple of times, > the error goes away and the app behaves as it should. This seems to > happen only when I first start work, almost as if the app is an > ancient Chevy that doesn''t want to roll over. Anybody else have this > trouble? > > Cheers, > J.D. > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >