Trouble deploying with Bundler and mixed Ruby server

Hey,

I have Ruby 1.8.7 (actually REE) and 1.9.2 on my server via RVM, REE is set as the default Ruby.

All my apps are configured with Capistrano and Bundler and the 1.8.7 apps deploy fine, however the 1.9.2 ones do not.

The issue is that Bundler is apparently ignoring the .rvmrc in the app root that should tell it to use 1.9.2, instead the gems end up in shared/bundle/ruby/1.8 and can't be found when the app tries to run with 1.9.2.

I've tried changing the command being executed on the server to 'rvm 1.9.2 && bundle ....', however it still uses 1.8.7.

The only thing I've found to work so far is changing the default Ruby on the server to 1.9.2, then it works, but instead all the 1.8.7 apps are hosed!

It seems like there is a Bundler configuration variable somewhere I need to set...

Any thoughts?

did you try rvm 1.9.2 exec bundle ...

Fred

Yep that works like a charm, nice one Fred, thanks!