Is there a way to specify in the rails application which ruby executable to use.

Basically I am stuck with a production app running on Rails 1.1.6
needing ruby 1.8.4, while we are working in trunk on getting Rails
1.2.3 working which needs ruby 1.8.6. I can set the version of rails
using RAILS_GEM_VERSION in environment.rb ... but where can I set the
version of ruby to use?

How are you serving up your rails app? If you use mongrel, you'll
need to patch up or copy and patch up /usr/bin/mongrel_rails. Change
the bang line to point to the binary of the version ruby you want to
run.

For example, if you installed ruby 1.8.4 with its binary at /usr/local/
bin/ruby1.8.4, then change the first line to:

#!/usr/local/bin/ruby1.8.4

It should cause mongrel and, subsequently, rails to be run under that
version of ruby.

Thanks for the tip.

We are using mongrel. The issue is more on our development boxes
though. We have to do updates on the old version until the 1.2.3
version has had a chance to be tested and is stable, which means
switching back and fourth a lot. I think I can probably modify script/
server as you suggested and maybe patch rake if that is necessary.
Another possibility is to put a symlink to the correct ruby executable
in subversion in the app directory and rewrite all the #! lines to
point to that.

I had hoped that there might be an "official" way to do this as I can
see it happening frequently as ruby/rails changes.