Topic: RVM::IncompatibleRubyError for new rails application

I have a Debian server running Apache and Passenger in production. RVM is installed and I have ruby-1.9.2-p136 as my default ruby. Passenger is configured with the default ruby. I currently have 10 Rails 3 applications running, each with its own gemset. Today I tried to deploy a new application and I am getting the error:
"The given ruby environment requires system (versus ruby-1.9.2-p136) (RVM::IncompatibleRubyError)"

I am using the same ruby for the application as I am for Passenger.

Does anyone know why I might be getting this error?

Below is the backtrace:
0    /usr/local/rvm/lib/rvm/environment/utility.rb    167    in `use_env_from_result!'
1    /usr/local/rvm/lib/rvm/environment/rubies.rb    30    in `use'
2    /usr/local/rvm/lib/rvm/environment/rubies.rb    36    in `use!'
3    /usr/local/rvm/lib/rvm/environment/rubies.rb    44    in `use_from_path!'
4    /usr/local/rvm/lib/rvm.rb    152    in `method_missing'
5    /var/www/batch_trace/config/setup_load_paths.rb    9    in `'
6        lib/rubygems/custom_require>    29:in `require'
7        lib/rubygems/custom_require>    29:in `require'
8    /usr/local/rvm/gems/ruby-1.9.2-p136/gems/passenger-3.0.2/lib/phusion_passenger/utils.rb    301    in `prepare_app_process'
9    /usr/local/rvm/gems/ruby-1.9.2-p136/gems/passenger-3.0.2/lib/phusion_passenger/rack/application_spawner.rb    155    in `block in initialize_server'
10    /usr/local/rvm/gems/ruby-1.9.2-p136/gems/passenger-3.0.2/lib/phusion_passenger/utils.rb    564    in `report_app_init_status'
11    /usr/local/rvm/gems/ruby-1.9.2-p136/gems/passenger-3.0.2/lib/phusion_passenger/rack/application_spawner.rb    153    in `initialize_server'
12    /usr/local/rvm/gems/ruby-1.9.2-p136/gems/passenger-3.0.2/lib/phusion_passenger/abstract_server.rb    204    in `start_synchronously'
13    /usr/local/rvm/gems/ruby-1.9.2-p136/gems/passenger-3.0.2/lib/phusion_passenger/abstract_server.rb    180    in `start'
14    /usr/local/rvm/gems/ruby-1.9.2-p136/gems/passenger-3.0.2/lib/phusion_passenger/rack/application_spawner.rb    128    in `start'
15    /usr/local/rvm/gems/ruby-1.9.2-p136/gems/passenger-3.0.2/lib/phusion_passenger/spawn_manager.rb    253    in `block (2 levels) in spawn_rack_application'
16    /usr/local/rvm/gems/ruby-1.9.2-p136/gems/passenger-3.0.2/lib/phusion_passenger/abstract_server_collection.rb    132    in `lookup_or_add'
17    /usr/local/rvm/gems/ruby-1.9.2-p136/gems/passenger-3.0.2/lib/phusion_passenger/spawn_manager.rb    246    in `block in spawn_rack_application'
18    /usr/local/rvm/gems/ruby-1.9.2-p136/gems/passenger-3.0.2/lib/phusion_passenger/abstract_server_collection.rb    82    in `block in synchronize'
19        prelude>    10:in `synchronize'
20    /usr/local/rvm/gems/ruby-1.9.2-p136/gems/passenger-3.0.2/lib/phusion_passenger/abstract_server_collection.rb    79    in `synchronize'
21    /usr/local/rvm/gems/ruby-1.9.2-p136/gems/passenger-3.0.2/lib/phusion_passenger/spawn_manager.rb    244    in `spawn_rack_application'
22    /usr/local/rvm/gems/ruby-1.9.2-p136/gems/passenger-3.0.2/lib/phusion_passenger/spawn_manager.rb    137    in `spawn_application'
23    /usr/local/rvm/gems/ruby-1.9.2-p136/gems/passenger-3.0.2/lib/phusion_passenger/spawn_manager.rb    275    in `handle_spawn_application'
24    /usr/local/rvm/gems/ruby-1.9.2-p136/gems/passenger-3.0.2/lib/phusion_passenger/abstract_server.rb    357    in `server_main_loop'
25    /usr/local/rvm/gems/ruby-1.9.2-p136/gems/passenger-3.0.2/lib/phusion_passenger/abstract_server.rb    206    in `start_synchronously'
26    /usr/local/rvm/gems/ruby-1.9.2-p136/gems/passenger-3.0.2/helper-scripts/passenger-spawn-server    99    in `'

Last edited by aarons (2012-01-17 14:18:12)

Re: RVM::IncompatibleRubyError for new rails application

Here is more detailed info from my apache error log:

[ pid=14510 thr=16337520 file=utils.rb:176 time=2012-01-17 12:18:46.323 ]: *** Exception PhusionPassenger::UnknownError in PhusionPassenger::Rack::ApplicationSpawner (The given ruby environment requires system (versus ruby-1.9.2-p136) (RVM::IncompatibleRubyError)) (process 14510, thread #<Thread:0x00000001f294e0>):
    from /usr/local/rvm/lib/rvm/environment/utility.rb:167:in `use_env_from_result!'
    from /usr/local/rvm/lib/rvm/environment/rubies.rb:30:in `use'
    from /usr/local/rvm/lib/rvm/environment/rubies.rb:36:in `use!'
    from /usr/local/rvm/lib/rvm/environment/rubies.rb:44:in `use_from_path!'
    from /usr/local/rvm/lib/rvm.rb:152:in `method_missing'
    from /var/www/batchtrace/config/setup_load_paths.rb:9:in `<top (required)>'
    from <internal:lib/rubygems/custom_require>:29:in `require'
    from <internal:lib/rubygems/custom_require>:29:in `require'
    from /usr/local/rvm/gems/ruby-1.9.2-p136/gems/passenger-3.0.2/lib/phusion_passenger/utils.rb:301:in `prepare_app_process'
    from /usr/local/rvm/gems/ruby-1.9.2-p136/gems/passenger-3.0.2/lib/phusion_passenger/rack/application_spawner.rb:155:in `block in initialize_server'
    from /usr/local/rvm/gems/ruby-1.9.2-p136/gems/passenger-3.0.2/lib/phusion_passenger/utils.rb:564:in `report_app_init_status'
    from /usr/local/rvm/gems/ruby-1.9.2-p136/gems/passenger-3.0.2/lib/phusion_passenger/rack/application_spawner.rb:153:in `initialize_server'
    from /usr/local/rvm/gems/ruby-1.9.2-p136/gems/passenger-3.0.2/lib/phusion_passenger/abstract_server.rb:204:in `start_synchronously'
    from /usr/local/rvm/gems/ruby-1.9.2-p136/gems/passenger-3.0.2/lib/phusion_passenger/abstract_server.rb:180:in `start'
    from /usr/local/rvm/gems/ruby-1.9.2-p136/gems/passenger-3.0.2/lib/phusion_passenger/rack/application_spawner.rb:128:in `start'
    from /usr/local/rvm/gems/ruby-1.9.2-p136/gems/passenger-3.0.2/lib/phusion_passenger/spawn_manager.rb:253:in `block (2 levels) in spawn_rack_application'
    from /usr/local/rvm/gems/ruby-1.9.2-p136/gems/passenger-3.0.2/lib/phusion_passenger/abstract_server_collection.rb:132:in `lookup_or_add'
    from /usr/local/rvm/gems/ruby-1.9.2-p136/gems/passenger-3.0.2/lib/phusion_passenger/spawn_manager.rb:246:in `block in spawn_rack_application'
    from /usr/local/rvm/gems/ruby-1.9.2-p136/gems/passenger-3.0.2/lib/phusion_passenger/abstract_server_collection.rb:82:in `block in synchronize'
    from <internal:prelude>:10:in `synchronize'
    from /usr/local/rvm/gems/ruby-1.9.2-p136/gems/passenger-3.0.2/lib/phusion_passenger/abstract_server_collection.rb:79:in `synchronize'
    from /usr/local/rvm/gems/ruby-1.9.2-p136/gems/passenger-3.0.2/lib/phusion_passenger/spawn_manager.rb:244:in `spawn_rack_application'
    from /usr/local/rvm/gems/ruby-1.9.2-p136/gems/passenger-3.0.2/lib/phusion_passenger/spawn_manager.rb:137:in `spawn_application'
    from /usr/local/rvm/gems/ruby-1.9.2-p136/gems/passenger-3.0.2/lib/phusion_passenger/spawn_manager.rb:275:in `handle_spawn_application'
    from /usr/local/rvm/gems/ruby-1.9.2-p136/gems/passenger-3.0.2/lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
    from /usr/local/rvm/gems/ruby-1.9.2-p136/gems/passenger-3.0.2/lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
    from /usr/local/rvm/gems/ruby-1.9.2-p136/gems/passenger-3.0.2/helper-scripts/passenger-spawn-server:99:in `<main>'