# Is there a way to specify in the rails application which rub

**URL:** <https://www.ruby-forum.com/t/is-there-a-way-to-specify-in-the-rails-application-which-rub/103653>\
**Category:** Rails\
**Created:** [May 8, 2007, 10:41pm UTC](https://www.ruby-forum.com/t/is-there-a-way-to-specify-in-the-rails-application-which-rub/103653 "2007-05-08T22:41:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bhoult](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/9de053/32.png) [@bhoult](https://www.ruby-forum.com/u/bhoult)\
**Post date:** [May 8, 2007, 10:41pm UTC](https://www.ruby-forum.com/t/is-there-a-way-to-specify-in-the-rails-application-which-rub/103653/1 "2007-05-08T22:41:50Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![bhoult](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/9de053/32.png) [@bhoult](https://www.ruby-forum.com/u/bhoult)\
**Post date:** [May 9, 2007, 5:30am UTC](https://www.ruby-forum.com/t/is-there-a-way-to-specify-in-the-rails-application-which-rub/103653/2 "2007-05-09T05:30:30Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![bhoult](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/9de053/32.png) [@bhoult](https://www.ruby-forum.com/u/bhoult)\
**Post date:** [May 9, 2007, 3:16pm UTC](https://www.ruby-forum.com/t/is-there-a-way-to-specify-in-the-rails-application-which-rub/103653/3 "2007-05-09T15:16:36Z")

</div>

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.
