Hi all; I''m trying to get rails running under fastcgi, but the fastcgi.crash.logindicates that it can''t find the "project_dev" database. Which is correct, because that database doesn''t exist. The thing is, the RAILS_ENV doesn''t seem to be getting set correctly. I''m basing the config file off of the example in the Prag Rails book. My FastCgiServer entry looks like this: FastCgiServer /home/scora002/typo/public/dispatch.fcgi \ -initial-env RAILS_ENV=production -processes 2 -idle-timeout 60 I know that Apache is finding and running this line correctly, because if I change the number of processes and restart the server, I can see that the number of processes it spawns does indeed change. Is there something else that I''m doing wrong here? Thanks. -- Lou _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Lou Maybe you could, as a work around, replace the second line in environment.rb with [[code:]] RAILS_ENV = ENV[''RAILS_ENV''] || ''production'' Jaap On 10/18/05, Louis J Scoras <louis.j.scoras-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi all; > > I''m trying to get rails running under fastcgi, but the fastcgi.crash.log > indicates that it can''t find the "project_dev" database. Which is correct, > because that database doesn''t exist. > > The thing is, the RAILS_ENV doesn''t seem to be getting set correctly. I''m > basing the config file off of the example in the Prag Rails book. My > FastCgiServer entry looks like this: > > FastCgiServer /home/scora002/typo/public/dispatch.fcgi > \ > -initial-env RAILS_ENV=production -processes 2 -idle-timeout 60 > > I know that Apache is finding and running this line correctly, because if I > change the number of processes and restart the server, I can see that the > number of processes it spawns does indeed change. > > Is there something else that I''m doing wrong here? > > Thanks. > > > -- > Lou > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >
Lou, I''m very sorry indeed to spam the mailinglist this way, but I ment [[code:]] RAILS_ENV = ''production'' ofcourse :-) Sorry again, Jaap On 10/18/05, Jaap Schreurs <jhschreurs-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Lou > > Maybe you could, as a work around, replace the second line in > environment.rb with > [[code:]] RAILS_ENV = ENV[''RAILS_ENV''] || ''production'' > > Jaap > > On 10/18/05, Louis J Scoras <louis.j.scoras-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > Hi all; > > > > I''m trying to get rails running under fastcgi, but the fastcgi.crash.log > > indicates that it can''t find the "project_dev" database. Which is correct, > > because that database doesn''t exist. > > > > The thing is, the RAILS_ENV doesn''t seem to be getting set correctly. I''m > > basing the config file off of the example in the Prag Rails book. My > > FastCgiServer entry looks like this: > > > > FastCgiServer /home/scora002/typo/public/dispatch.fcgi > > \ > > -initial-env RAILS_ENV=production -processes 2 -idle-timeout 60 > > > > I know that Apache is finding and running this line correctly, because if I > > change the number of processes and restart the server, I can see that the > > number of processes it spawns does indeed change. > > > > Is there something else that I''m doing wrong here? > > > > Thanks. > > > > > > -- > > Lou > > > > _______________________________________________ > > Rails mailing list > > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > >
Jaap; [[code:]] RAILS_ENV = ''production'' That''s a good suggestion. As a work-around I was just changing the database handle information in config/database.yml, but I think there''s more to the envrionment setting than just the database connection settings. Calling config/[env].rb and how objects reload are dependant on this, if I read correctly. I''d still be curious as to why the variable isn''t getting set, but thanks for the helpful suggestion. I''ll probably use it in the meanwhile. Thanks. -- Lou _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
On 18 Oct 2005, at 4:07 pm, Louis J Scoras wrote:> I''m trying to get rails running under fastcgi, but the > fastcgi.crash.log indicates that it can''t find the "project_dev" > database. Which is correct, because that database doesn''t exist. > > The thing is, the RAILS_ENV doesn''t seem to be getting set > correctly. I''m basing the config file off of the example in the > Prag Rails book. My FastCgiServer entry looks like this: > > FastCgiServer /home/scora002/typo/public/dispatch.fcgi \ > -initial-env RAILS_ENV=production -processes 2 -idle-timeout 60 > > I know that Apache is finding and running this line correctly, > because if I change the number of processes and restart the server, > I can see that the number of processes it spawns does indeed change.I''ve just fixed a similar problem on my server. It turned out that I''d forgotten to edit the .htaccess file to point at dispatch.fcgi instead of dispatch.cgi. So Apache was spawning FastCGI processes okay, but the requests were actually getting handled via CGI, which was defaulting to the development environment. Could this be the case on your server? Chris
I am a bit vague on this, but I remember running into something similar and i ended up specifying the enviorment to be production in my environment.rb file for my RoR app. ... ... # Uncomment below to force Rails into production mode when # you don''t control web/app server and can''t set it the proper way ENV[''RAILS_ENV''] ||= ''production'' .... ... Once I did that my app was in production mode. I ended up this route since the RAILS_ENV=production was not taking effect in the FastCgiServer directive in my apache config file. Hope this helps, Chris Mear wrote:> On 18 Oct 2005, at 4:07 pm, Louis J Scoras wrote: > >> I''m trying to get rails running under fastcgi, but the >> fastcgi.crash.log indicates that it can''t find the "project_dev" >> database. Which is correct, because that database doesn''t exist. >> >> The thing is, the RAILS_ENV doesn''t seem to be getting set >> correctly. I''m basing the config file off of the example in the >> Prag Rails book. My FastCgiServer entry looks like this: >> >> FastCgiServer /home/scora002/typo/public/dispatch.fcgi \ >> -initial-env RAILS_ENV=production -processes 2 -idle-timeout 60 >> >> I know that Apache is finding and running this line correctly, >> because if I change the number of processes and restart the server, >> I can see that the number of processes it spawns does indeed change. > > > I''ve just fixed a similar problem on my server. It turned out that > I''d forgotten to edit the .htaccess file to point at dispatch.fcgi > instead of dispatch.cgi. > > So Apache was spawning FastCGI processes okay, but the requests were > actually getting handled via CGI, which was defaulting to the > development environment. > > Could this be the case on your server? > > Chris > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails