Topic: Phussion Passenger could not see config/environment.rb

System:
Ubuntu 10.04 LTS
Apache2.2
Rails 2.1
Ruby 1.86
Passenger

Once I run my site, I get Error 500 in my logs and this is what I found,
*** Exception Errno::ENOENT in spawn manager (No such file or directory - config/environment.rb) (process 25017):
Followed by lots of extra lines...

Does anyone knew or have encountered this problem before, any help is appreciated. Thanks

Re: Phussion Passenger could not see config/environment.rb

I would suspect it is either a permissions problem or you have something wrong in your virtual host configuration.  Can you post the configuration for the virtual host (from sites-enabled).

Norm

Re: Phussion Passenger could not see config/environment.rb

This really belongs on an Apache board.

First place to start is your Apache, and check that the PATHS are correctly pointing to the root of where your Rails app is.
This example is for a virtual host:

<VirtualHost *:80>
  ServerName sameandsave.com
  DirectoryIndex index.html dispatch.fcgi
  DocumentRoot /your_account_root/rails_app/public
  CustomLog /your_account_root/logs/access_log combined
  ScriptAlias /cgi-bin/ /your_account_root/cgi-bin/
  ScriptAlias /fcgi-bin/ /your_account_root/fcgi-bin/
  <Directory /your_account_root/rails_app/public>
    Options -Indexes IncludesNOEXEC FollowSymLinks -MultiViews
    AllowOverride All
    Order allow,deny
    Allow from all
  </Directory>
  <Directory /your_account_root/cgi-bin>
    Order allow,deny
    Allow from all
  </Directory>
</VirtualHost>

Where your_account_root is the home directory of the account running apache,  and rails_app is the subdirectory in THAT home directory where the rails app is.

The directories you enter should look something like:

/users/bob

and

/users/bob/myrailsapp

Joe got a job, on the day shift, at the Utility Muffin Research Kitchen, arrogantly twisting the sterile canvas snout of a fully charged icing anointment utensil.

Re: Phussion Passenger could not see config/environment.rb

Thanks for the reply. I was really thinking that apache configuration has something to do with it but I can't figure out the cause.
I have my structure like this, rails application was stored inside /usr/folder_name and I have linked the public folder to /var/www/folder_name
All files have 755 privileges with root as the owner except for log files which has write privileges.

My Virtual Host configuration was something like this:

<VirtualHost *:80>
   ServerName railsapp.school.edu
   DocumentRoot /var/www/folder_name
   RailsEnv production
   RailsBaseURI  /
   
   # Other Lines for Custom Logs.....

</VirtualHost>

Before my RailsBaseURI was pointing to /var/www/folder_name but instead of showing the site, it shows the directory structure inside public folder. So I decided to play with that line, Upon changing it to / only, the error shows up.

Thanks for any help.

Re: Phussion Passenger could not see config/environment.rb

I have tested it this afternoon and this is what I have used in my server:

<VirtualHost *:80>
   ServerName railsapp.school.edu
   DocumentRoot /var/www/
   RailsEnv production
<Directory /var/www/>
Allow from all
</Directory>
   RailsBaseURI  /folder_name
<Directory /var/www/folder_name>
AllowOverride all
Options FollowSymLinks -MultiViews
Allow from all
</Directory>
   # Other Lines for Custom Logs.....

</VirtualHost>

I'm still not sure if I did the right thing, in effect to this, I placed a php file on the root directory (/var/www) and edit the source code( because there are some parts that require embeding with syntax like this "/mediaplayer.swf" which are hardcoded ) Leaving the code as is, the application assumes that the file is somewhere on http://railsapp.school.edu/mediaplayer.swf instead of http://railsapp.school.edu/folder_name/medipalyer.swf