# Gem + passenger throw error

**URL:** <https://www.ruby-forum.com/t/gem-passenger-throw-error/183960>\
**Category:** Rails\
**Created:** [February 23, 2010, 4:07am UTC](https://www.ruby-forum.com/t/gem-passenger-throw-error/183960 "2010-02-23T04:07:29Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![ggironda](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/9e8a1a/32.png) [@ggironda](https://www.ruby-forum.com/u/ggironda)\
**Post date:** [February 23, 2010, 4:07am UTC](https://www.ruby-forum.com/t/gem-passenger-throw-error/183960/1 "2010-02-23T04:07:29Z")

</div>

Hi

Bonjour,

I’ve followed different tutos :  
[https://help.ubuntu.com/community/RubyOnRails](https://help.ubuntu.com/community/RubyOnRails)  
[http://blog.lelevier.fr/redmine-sous-apache-avec-passenger/](http://blog.lelevier.fr/redmine-sous-apache-avec-passenger/)  
[http://doc.ubuntu-fr.org/redmine#servir\_redmine\_via\_apache](http://doc.ubuntu-fr.org/redmine#servir_redmine_via_apache)

trying to install ruby on rails and Redmine.

Everything looks fine till I try to access to :  
[http://192.168.60.10/redmine/](http://192.168.60.10/redmine/)

J’obtiens le message d’erreur suivant :

`Error message:
    Rails requires RubyGems >= 1.3.2 (you have 0.9.4). Please `gem
update --system` and try again.`

`# File Line Location
0 /opt/redmine/config/boot.rb 89 in `exit'
1 /opt/redmine/config/boot.rb 89 in `load_rubygems'
2 /opt/redmine/config/boot.rb 53 in `load_initializer'
3 /opt/redmine/config/boot.rb 38 in `run'
4 /opt/redmine/config/boot.rb 11 in `boot!'
5 /opt/redmine/config/boot.rb 110
6 /usr/lib/ruby/1.8/rubygems/custom_require.rb 27 in
`gem_original_require'
7 /usr/lib/ruby/1.8/rubygems/custom_require.rb 27 in `require'
8 /opt/redmine/config/environment.rb 11
9 /usr/lib/ruby/1.8/rubygems/custom_require.rb 27 in
`gem_original_require'
10 /usr/lib/ruby/1.8/rubygems/custom_require.rb 27 in `require'
11
/usr/local/lib/ruby/gems/1.8/gems/passenger-2.2.10/lib/phusion_passenger/railz/application_spawner.rb
303 in `preload_application'
12
/usr/local/lib/ruby/gems/1.8/gems/passenger-2.2.10/lib/phusion_passenger/railz/application_spawner.rb
252 in `initialize_server'
13
/usr/local/lib/ruby/gems/1.8/gems/passenger-2.2.10/lib/phusion_passenger/utils.rb
255 in `report_app_init_status'
14
/usr/local/lib/ruby/gems/1.8/gems/passenger-2.2.10/lib/phusion_passenger/railz/application_spawner.rb
237 in `initialize_server'
15
/usr/local/lib/ruby/gems/1.8/gems/passenger-2.2.10/lib/phusion_passenger/abstract_server.rb
194 in `start_synchronously'
16
/usr/local/lib/ruby/gems/1.8/gems/passenger-2.2.10/lib/phusion_passenger/abstract_server.rb
163 in `start'
17
/usr/local/lib/ruby/gems/1.8/gems/passenger-2.2.10/lib/phusion_passenger/railz/application_spawner.rb
213 in `start'
18
/usr/local/lib/ruby/gems/1.8/gems/passenger-2.2.10/lib/phusion_passenger/spawn_manager.rb
262 in `spawn_rails_application'
19
/usr/local/lib/ruby/gems/1.8/gems/passenger-2.2.10/lib/phusion_passenger/abstract_server_collection.rb
126 in `lookup_or_add'
20
/usr/local/lib/ruby/gems/1.8/gems/passenger-2.2.10/lib/phusion_passenger/spawn_manager.rb
256 in `spawn_rails_application'
21
/usr/local/lib/ruby/gems/1.8/gems/passenger-2.2.10/lib/phusion_passenger/abstract_server_collection.rb
80 in `synchronize'
22
/usr/local/lib/ruby/gems/1.8/gems/passenger-2.2.10/lib/phusion_passenger/abstract_server_collection.rb
79 in `synchronize'
23
/usr/local/lib/ruby/gems/1.8/gems/passenger-2.2.10/lib/phusion_passenger/spawn_manager.rb
255 in `spawn_rails_application'
24
/usr/local/lib/ruby/gems/1.8/gems/passenger-2.2.10/lib/phusion_passenger/spawn_manager.rb
154 in `spawn_application'
25
/usr/local/lib/ruby/gems/1.8/gems/passenger-2.2.10/lib/phusion_passenger/spawn_manager.rb
287 in `handle_spawn_application'
26
/usr/local/lib/ruby/gems/1.8/gems/passenger-2.2.10/lib/phusion_passenger/abstract_server.rb
352 in ` __send__'
27
/usr/local/lib/ruby/gems/1.8/gems/passenger-2.2.10/lib/phusion_passenger/abstract_server.rb
352 in `main_loop'
28
/usr/local/lib/ruby/gems/1.8/gems/passenger-2.2.10/lib/phusion_passenger/abstract_server.rb
196 in `start_synchronously'
29
/usr/local/lib/ruby/gems/1.8/gems/passenger-2.2.10/bin/passenger-spawn-server
61`  
Alors que si je fais :

```auto
gem list
```

j’ai bien la bonne version…

[code]\*\*\* LOCAL GEMS \*\*\*

actionmailer (2.3.5)  
actionpack (2.3.5)  
activerecord (2.3.5)  
activeresource (2.3.5)  
activesupport (2.3.5)  
fastthread (1.0.7)  
mysql (2.8.1)  
passenger (2.2.10)  
rack (1.0.1)  
rails (2.3.5)  
rake (0.8.7)  
rmagick (2.12.2)  
rubygems-update (1.3.6)[/code]  
idem pour

```auto
gem environment
```

[code]RubyGems Environment:

- RUBYGEMS VERSION: 1.3.6
- RUBY VERSION: 1.8.7 (2009-06-12 patchlevel 174) [i686-linux]
- INSTALLATION DIRECTORY: /usr/local/lib/ruby/gems/1.8
- RUBY EXECUTABLE: /usr/local/bin/ruby
- EXECUTABLE DIRECTORY: /usr/local/bin
- RUBYGEMS PLATFORMS:
  - ruby
  - x86-linux

- GEM PATHS:
  - /usr/local/lib/ruby/gems/1.8
  - /home/gabriel/.gem/ruby/1.8

- GEM CONFIGURATION:
  - :update\_sources =\> true
  - :verbose =\> true
  - :benchmark =\> false
  - :backtrace =\> false
  - :bulk\_threshold =\> 1000

- REMOTE SOURCES:
  - [http://rubygems.org/[/code]](http://rubygems.org/%5B/code%5D)

Where does he get “you have 0.9.4 ???”  
Thank you by advance !

P.S :  
I’ve also tried :  
@SAVANE:/usr/bin$ /usr/local/bin/gem --version  
1.3.6  
@SAVANE:/usr/bin$ gem -v  
1.3.6  
@SAVANE:/usr/bin$

/usr/bin/gem --version  
1.3.6

sudo update\_rubygems

---

<div class="post-metadata">

**Author:** ![ggironda](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/9e8a1a/32.png) [@ggironda](https://www.ruby-forum.com/u/ggironda)\
**Post date:** [February 23, 2010, 9:15am UTC](https://www.ruby-forum.com/t/gem-passenger-throw-error/183960/2 "2010-02-23T09:15:24Z")

</div>

You gotta set system enviroment var GEM\_HOME pointing to Your gems  
directory.

I have accomplished it by adding Set Env in VirtualHost configuration.  
It needs to have enabled mod\_env in apache, by  
$~/ sudo a2enmod env

\<VirtualHost \*:80\>  
DocumentRoot /home/user/repos/rails\_project/public  
ServerName rails.local  
ServerAlias \*.rails.local

```
RailsEnv development
RailsAllowModRewrite off
SetEnv GEM_HOME /home/user/rvm/gems/ruby-1.8.7-p249%rails2

ErrorLog /var/log/apache2/error.log
CustomLog /var/log/apache2/access.log combined
 <Directory /home/user/repos/rails_project/public>
    AllowOverride all
    Options -MultiViews
    Order allow,deny
    Allow from all
 </Directory>

```

Another good point is to start using RVM (Ruby Version Manager),  
[http://rvm.beginrescueend.com/](http://rvm.beginrescueend.com/)

For You it would be:  
SetEnv GEM\_HOME /usr/local/lib/ruby/gems/1.8

Best,  
Martin

---

<div class="post-metadata">

**Author:** ![ggironda](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/9e8a1a/32.png) [@ggironda](https://www.ruby-forum.com/u/ggironda)\
**Post date:** [February 23, 2010, 10:16am UTC](https://www.ruby-forum.com/t/gem-passenger-throw-error/183960/3 "2010-02-23T10:16:46Z")

</div>

Marcin Seroczynski wrote:

> You gotta set system enviroment var GEM\_HOME pointing to Your gems  
> directory.
> 
> I have accomplished it by adding Set Env in VirtualHost configuration.  
> It needs to have enabled mod\_env in apache, by  
> $~/ sudo a2enmod env
> 
> \<VirtualHost \*:80\>  
> DocumentRoot /home/user/repos/rails\_project/public  
> ServerName rails.local  
> ServerAlias \*.rails.local
> 
> ```
> RailsEnv development
> RailsAllowModRewrite off
> SetEnv GEM_HOME /home/user/rvm/gems/ruby-1.8.7-p249%rails2
> 
> ErrorLog /var/log/apache2/error.log
> CustomLog /var/log/apache2/access.log combined
> <Directory /home/user/repos/rails_project/public>
> AllowOverride all
> Options -MultiViews
> Order allow,deny
> Allow from all
> </Directory>
> 
> ```
> 
> Another good point is to start using RVM (Ruby Version Manager),  
> [http://rvm.beginrescueend.com/](http://rvm.beginrescueend.com/)
> 
> For You it would be:  
> SetEnv GEM\_HOME /usr/local/lib/ruby/gems/1.8
> 
> Best,  
> Martin

Thank you very much ! I make a small foot forward. Now I have an html  
page displaying :

Application error  
Rails application failed to start properly

If I take a look in the error.log from apache, I’ve got :

[Tue Feb 23 10:10:50 2010] [notice] Apache/2.2.8 (Ubuntu)  
Phusion\_Passenger/2.2.10 PHP/5.2.4-2ubuntu5.7 with Suhosin-Patch  
configured – resuming normal operations  
\*\*\* Passenger ERROR (ext/common/SpawnManager.h:232):  
Could not start the spawn server: /usr/bin/ruby1.8: No such file or  
directory (2)  
[ pid=28449 file=ext/apache2/Hooks.cpp:727 time=2010-02-23 10:10:55.952  
]:  
Unexpected error in mod\_passenger: Cannot spawn application  
‘/opt/redmine’: Could not write ‘spawn\_application’ command to the spawn  
server: Broken pipe (32)  
Backtrace:  
in ‘virtual boost::shared\_ptrPassenger::Application::Session  
Passenger::ApplicationPoolServer::Client::get(const  
Passenger::PoolOptions&)’ (ApplicationPoolServer.h:471)  
in ‘int Hooks::handleRequest(request\_rec\*)’ (Hooks.cpp:523)

[Tue Feb 23 10:10:58 2010] [error] [client 192.168.60.11] File does not  
exist: /var/www/favicon.ico

Looks, we had a write permission issue ? and why the hell, he’s trying  
to load /var/www/favicon.ico, he should look into opt/redmine instead…

Thanks a lot again !

---

<div class="post-metadata">

**Author:** ![ggironda](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/9e8a1a/32.png) [@ggironda](https://www.ruby-forum.com/u/ggironda)\
**Post date:** [February 23, 2010, 10:18am UTC](https://www.ruby-forum.com/t/gem-passenger-throw-error/183960/4 "2010-02-23T10:18:03Z")

</div>

Gabriel Gabriel wrote:

> Marcin Seroczynski wrote:
> 
> > You gotta set system enviroment var GEM\_HOME pointing to Your gems  
> > directory.
> > 
> > I have accomplished it by adding Set Env in VirtualHost configuration.  
> > It needs to have enabled mod\_env in apache, by  
> > $~/ sudo a2enmod env
> > 
> > \<VirtualHost \*:80\>  
> > DocumentRoot /home/user/repos/rails\_project/public  
> > ServerName rails.local  
> > ServerAlias \*.rails.local
> > 
> > ```
> > RailsEnv development
> > RailsAllowModRewrite off
> > SetEnv GEM_HOME /home/user/rvm/gems/ruby-1.8.7-p249%rails2
> > 
> > ErrorLog /var/log/apache2/error.log
> > CustomLog /var/log/apache2/access.log combined
> > <Directory /home/user/repos/rails_project/public>
> > AllowOverride all
> > Options -MultiViews
> > Order allow,deny
> > Allow from all
> > </Directory>
> > 
> > ```
> > 
> > Another good point is to start using RVM (Ruby Version Manager),  
> > [http://rvm.beginrescueend.com/](http://rvm.beginrescueend.com/)
> > 
> > For You it would be:  
> > SetEnv GEM\_HOME /usr/local/lib/ruby/gems/1.8
> > 
> > Best,  
> > Martin
> 
> Thank you very much ! I make a small foot forward. Now I have an html  
> page displaying :
> 
> Application error  
> Rails application failed to start properly
> 
> If I take a look in the error.log from apache, I’ve got :
> 
> [Tue Feb 23 10:10:50 2010] [notice] Apache/2.2.8 (Ubuntu)  
> Phusion\_Passenger/2.2.10 PHP/5.2.4-2ubuntu5.7 with Suhosin-Patch  
> configured – resuming normal operations  
> \*\*\* Passenger ERROR (ext/common/SpawnManager.h:232):  
> Could not start the spawn server: /usr/bin/ruby1.8: No such file or  
> directory (2)  
> [ pid=28449 file=ext/apache2/Hooks.cpp:727 time=2010-02-23 10:10:55.952  
> ]:  
> Unexpected error in mod\_passenger: Cannot spawn application  
> ‘/opt/redmine’: Could not write ‘spawn\_application’ command to the spawn  
> server: Broken pipe (32)  
> Backtrace:  
> in ‘virtual boost::shared\_ptrPassenger::Application::Session  
> Passenger::ApplicationPoolServer::Client::get(const  
> Passenger::PoolOptions&)’ (ApplicationPoolServer.h:471)  
> in ‘int Hooks::handleRequest(request\_rec\*)’ (Hooks.cpp:523)
> 
> [Tue Feb 23 10:10:58 2010] [error] [client 192.168.60.11] File does not  
> exist: /var/www/favicon.ico
> 
> Looks, we had a write permission issue ? and why the hell, he’s trying  
> to load /var/www/favicon.ico, he should look into opt/redmine instead…
> 
> Thanks a lot again !

Here is my /etc/apache2/sites-available/default :

\<VirtualHost \*:80\>  
ServerAdmin webmaster@localhost  
ServerName localhost

```
    DocumentRoot /var/www
    RailsEnv production
    RailsBaseURI /redmine
    SetEnv GEM_HOME /usr/local/lib/ruby/gems/1.8

    <Directory /opt/redmine/public/>
            Options FollowSymLinks
            AllowOverride None
            Order deny,allow
            Allow from all
    </Directory>

    ErrorLog /var/log/apache2/error.log
    LogLevel warn
    CustomLog /var/log/apache2/access.log combined

```

Thanks again !

---

<div class="post-metadata">

**Author:** ![ggironda](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/9e8a1a/32.png) [@ggironda](https://www.ruby-forum.com/u/ggironda)\
**Post date:** [February 23, 2010, 12:27pm UTC](https://www.ruby-forum.com/t/gem-passenger-throw-error/183960/5 "2010-02-23T12:27:59Z")

</div>

Does /usr/bin/ruby1.8 exist and is it executable?

–  
Andy J.  
[http://andyjeffries.co.uk/](http://andyjeffries.co.uk/)#rubyonrails #mysql #jquery  
Registered address: 64 Sish Lane, Stevenage, Herts, SG1 3LS  
Company number: 5452840

---

<div class="post-metadata">

**Author:** ![ggironda](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/9e8a1a/32.png) [@ggironda](https://www.ruby-forum.com/u/ggironda)\
**Post date:** [February 23, 2010, 12:31pm UTC](https://www.ruby-forum.com/t/gem-passenger-throw-error/183960/6 "2010-02-23T12:31:22Z")

</div>

Andy J. wrote:

> Does /usr/bin/ruby1.8 exist and is it executable?
> 
> –  
> Andy J.  
> [http://andyjeffries.co.uk/](http://andyjeffries.co.uk/)#rubyonrails #mysql #jquery  
> Registered address: 64 Sish Lane, Stevenage, Herts, SG1 3LS  
> Company number: 5452840

Hum… no !  
Should I try to make a simbolyc link ? like

ln -s /usr/local/bin/ruby /usr/bin/ruby1.8

?

Thanks a lot !

---

<div class="post-metadata">

**Author:** ![ggironda](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/9e8a1a/32.png) [@ggironda](https://www.ruby-forum.com/u/ggironda)\
**Post date:** [February 23, 2010, 6:25pm UTC](https://www.ruby-forum.com/t/gem-passenger-throw-error/183960/7 "2010-02-23T18:25:22Z")

</div>

Gabriel Gabriel wrote:

> Andy J. wrote:
> 
> > Does /usr/bin/ruby1.8 exist and is it executable?
> > 
> > –  
> > Andy J.  
> > [http://andyjeffries.co.uk/](http://andyjeffries.co.uk/)#rubyonrails #mysql #jquery  
> > Registered address: 64 Sish Lane, Stevenage, Herts, SG1 3LS  
> > Company number: 5452840
> 
> Hum… no !  
> Should I try to make a simbolyc link ? like
> 
> ln -s /usr/local/bin/ruby /usr/bin/ruby1.8
> 
> ?
> 
> Thanks a lot !

And It is done ! Thanks everybody !

sudo ln -s /usr/local/bin/ruby /usr/bin/ruby  
sudo ln -s /usr/bin/ruby /usr/bin/ruby1.8

---

<div class="post-metadata">

**Author:** ![ggironda](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/9e8a1a/32.png) [@ggironda](https://www.ruby-forum.com/u/ggironda)\
**Post date:** [February 23, 2010, 8:26pm UTC](https://www.ruby-forum.com/t/gem-passenger-throw-error/183960/8 "2010-02-23T20:26:12Z")

</div>

> Thanks a lot !  
> Give it a go - that’s what the error message was though.

Cheers,

Andy
