Gem + passenger throw error

Hi

Bonjour,

I’ve followed different tutos :
https://help.ubuntu.com/community/RubyOnRails
http://blog.lelevier.fr/redmine-sous-apache-avec-passenger/
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/

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 :

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

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:

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

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/

For You it would be:
SetEnv GEM_HOME /usr/local/lib/ruby/gems/1.8

Best,
Martin

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/

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 !

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/

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 !

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


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

Andy J. wrote:

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


Andy J.
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 !

Gabriel Gabriel wrote:

Andy J. wrote:

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


Andy J.
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

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

Cheers,

Andy