# No such file to load -- config/environment - Apache2 & Passenger 2.1.1

**URL:** <https://www.ruby-forum.com/t/no-such-file-to-load-config-environment-apache2-passenger-2-1-1/162580>\
**Category:** Rails\
**Created:** [March 11, 2009, 3:43pm UTC](https://www.ruby-forum.com/t/no-such-file-to-load-config-environment-apache2-passenger-2-1-1/162580 "2009-03-11T15:43:00Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Basti](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/fbc32d/32.png) [@Basti](https://www.ruby-forum.com/u/Basti)\
**Post date:** [March 11, 2009, 3:43pm UTC](https://www.ruby-forum.com/t/no-such-file-to-load-config-environment-apache2-passenger-2-1-1/162580/1 "2009-03-11T15:43:00Z")

</div>

Hi,  
i recently started using Ruby and Ruby on Rails. For Development i’m  
using RadRails and InstantRails on my local Windows machine.

Atm i’m trying to get a basic application running on Ubuntu Server  
8.10 with Apache 2.2.9 & Phusion\_Passenger 2.1.1.  
Frist i tried to get just the app-sceleton generate by RadRails to  
work (which worked fine on InstantRails) and the i tried the same with  
Typo(blog).

In both cases i recieve the following error:

no such file to load – config/environment

When trying to get the basic application running i see the Welcome to  
Aptana RadRails page but when following “About your application’s  
environment” i get the mentioned message. Same after installing typo  
and going to admin page for first time.

The passenger backtrace is:  
0 /usr/local/lib/site\_ruby/1.8/rubygems/custom\_require.rb 31 in  
`gem_original_require' 1 /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb 31 in`require’  
2 /usr/lib/ruby/gems/1.8/gems/passenger-2.1.1/lib/phusion\_passenger/  
railz/application\_spawner.rb 267 in `preload_application' 3 /usr/lib/ruby/gems/1.8/gems/passenger-2.1.1/lib/phusion_passenger/ railz/application_spawner.rb 227 in`initialize\_server’  
4 /usr/lib/ruby/gems/1.8/gems/passenger-2.1.1/lib/phusion\_passenger/  
utils.rb 211 in `report_app_init_status' 5 /usr/lib/ruby/gems/1.8/gems/passenger-2.1.1/lib/phusion_passenger/ railz/application_spawner.rb 216 in`initialize\_server’  
6 /usr/lib/ruby/gems/1.8/gems/passenger-2.1.1/lib/phusion\_passenger/  
abstract\_server.rb 180 in `start_synchronously' 7 /usr/lib/ruby/gems/1.8/gems/passenger-2.1.1/lib/phusion_passenger/ abstract_server.rb 149 in`start’  
8 /usr/lib/ruby/gems/1.8/gems/passenger-2.1.1/lib/phusion\_passenger/  
railz/application\_spawner.rb 192 in `start' 9 /usr/lib/ruby/gems/1.8/gems/passenger-2.1.1/lib/phusion_passenger/ spawn_manager.rb 260 in`spawn\_rails\_application’  
10 /usr/lib/ruby/gems/1.8/gems/passenger-2.1.1/lib/phusion\_passenger/  
abstract\_server\_collection.rb 121 in `lookup_or_add' 11 /usr/lib/ruby/gems/1.8/gems/passenger-2.1.1/lib/phusion_passenger/ spawn_manager.rb 254 in`spawn\_rails\_application’  
12 /usr/lib/ruby/gems/1.8/gems/passenger-2.1.1/lib/phusion\_passenger/  
abstract\_server\_collection.rb 75 in `synchronize' 13 /usr/lib/ruby/gems/1.8/gems/passenger-2.1.1/lib/phusion_passenger/ abstract_server_collection.rb 74 in`synchronize’  
14 /usr/lib/ruby/gems/1.8/gems/passenger-2.1.1/lib/phusion\_passenger/  
spawn\_manager.rb 253 in `spawn_rails_application' 15 /usr/lib/ruby/gems/1.8/gems/passenger-2.1.1/lib/phusion_passenger/ spawn_manager.rb 148 in`spawn\_application’  
16 /usr/lib/ruby/gems/1.8/gems/passenger-2.1.1/lib/phusion\_passenger/  
spawn\_manager.rb 285 in `handle_spawn_application' 17 /usr/lib/ruby/gems/1.8/gems/passenger-2.1.1/lib/phusion_passenger/ abstract_server.rb 332 in` **send** ’  
18 /usr/lib/ruby/gems/1.8/gems/passenger-2.1.1/lib/phusion\_passenger/  
abstract\_server.rb 332 in `main_loop' 19 /usr/lib/ruby/gems/1.8/gems/passenger-2.1.1/lib/phusion_passenger/ abstract_server.rb 182 in`start\_synchronously’  
20 /usr/lib/ruby/gems/1.8/gems/passenger-2.1.1/bin/passenger-spawn-  
server 46

I installed the following gems:

actionmailer (2.2.2)  
actionpack (2.2.2)  
activerecord (2.2.2)  
activeresource (2.2.2)  
activesupport (2.2.2)  
cgi\_multipart\_eof\_fix (2.5.0)  
coderay (0.8.312)  
columnize (0.3.0)  
daemons (1.0.10)  
datanoise-actionwebservice (2.2.2)  
eventmachine (0.12.6, 0.12.4)  
fastthread (1.0.1)  
flexmock (0.8.5, 0.8.4)  
gem\_plugin (0.2.3)  
htmlentities (4.0.0)  
json (1.1.3)  
linecache (0.43)  
mysql (2.7)  
passenger (2.1.1, 2.0.6)  
rack (0.9.1)  
rails (2.2.2)  
rails-app-installer (0.2.0)  
rake (0.8.4, 0.8.3)  
rspec (1.1.12)  
rspec-rails (1.1.12)  
ruby-debug (0.10.3)  
ruby-debug-base (0.10.3)  
sqlite3-ruby (1.2.4)  
will\_paginate (2.2.2)

In both cases i chowned the appbase and the tmp dir to the apache user  
all other files are owned by the owner of environment.rb

Thanks for your help in advance  
Basti

---

<div class="post-metadata">

**Author:** ![Basti](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/fbc32d/32.png) [@Basti](https://www.ruby-forum.com/u/Basti)\
**Post date:** [March 25, 2009, 6:18pm UTC](https://www.ruby-forum.com/t/no-such-file-to-load-config-environment-apache2-passenger-2-1-1/162580/2 "2009-03-25T18:18:55Z")

</div>

On Wed, Mar 25, 2009 at 9:40 AM, doron [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > Atm i’m trying to get a basic application running on Ubuntu Server  
> > 8.10 with Apache 2.2.9 & Phusion\_Passenger 2.1.1.  
> > Frist i tried to get just the app-sceleton generate by RadRails to  
> > work (which worked fine on InstantRails) and the i tried the same with  
> > Typo(blog).
> > 
> > In both cases i recieve the following error:
> > 
> > no such file to load – config/environment

Change the owner and group of the environment.rb file to the user and  
group  
of your apache2 instance (probably www-data). See if that helps.  
Cheers–

Charles

---

<div class="post-metadata">

**Author:** ![Basti](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/fbc32d/32.png) [@Basti](https://www.ruby-forum.com/u/Basti)\
**Post date:** [March 25, 2009, 4:09pm UTC](https://www.ruby-forum.com/t/no-such-file-to-load-config-environment-apache2-passenger-2-1-1/162580/3 "2009-03-25T16:09:07Z")

</div>

try here:  
[http://blog.scopeport.org/ruby-on-rails/phusion-passenger-error-file-directory-nonexistent/](http://blog.scopeport.org/ruby-on-rails/phusion-passenger-error-file-directory-nonexistent/)

Basti ×›×ª×‘:

---

<div class="post-metadata">

**Author:** ![Basti](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/fbc32d/32.png) [@Basti](https://www.ruby-forum.com/u/Basti)\
**Post date:** [March 26, 2009, 2:41pm UTC](https://www.ruby-forum.com/t/no-such-file-to-load-config-environment-apache2-passenger-2-1-1/162580/4 "2009-03-26T14:41:08Z")

</div>

I have the same problem, and the owner:group is root:www  
changing to www:www seems to only make things worse and i don’t even  
get the passenger error page.  
do you have any other idea?

i use:  
Rails 1.2.3  
passenger 2.1.2  
Apache/2.0.52 (CentOS)

---

<div class="post-metadata">

**Author:** ![Basti](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/fbc32d/32.png) [@Basti](https://www.ruby-forum.com/u/Basti)\
**Post date:** [March 26, 2009, 5:50pm UTC](https://www.ruby-forum.com/t/no-such-file-to-load-config-environment-apache2-passenger-2-1-1/162580/5 "2009-03-26T17:50:30Z")

</div>

: ok, solved for me.  
it is very important to read section 8.1 in the user guide:  
[Phusion Passenger users guide index](http://www.modrails.com/documentation/Users%20guide.html#_tips)

and also to remember set the correct RailsEnv in the conf file.

we went with:

PassengerUserSwitching off  
PassengerDefaultUser www  
RailsEnv something\_that\_is\_not\_production

---

<div class="post-metadata">

**Author:** ![Basti](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/fbc32d/32.png) [@Basti](https://www.ruby-forum.com/u/Basti)\
**Post date:** [March 27, 2009, 5:24pm UTC](https://www.ruby-forum.com/t/no-such-file-to-load-config-environment-apache2-passenger-2-1-1/162580/6 "2009-03-27T17:24:00Z")

</div>

Yes, CentOS is different than ubuntu. You had said at the beginning that  
you  
were running ubuntu.  
Cheers–

Charles
