# Rails version configuration

**URL:** <https://www.ruby-forum.com/t/rails-version-configuration/121575>\
**Category:** Rails\
**Created:** [November 29, 2007, 1:19am UTC](https://www.ruby-forum.com/t/rails-version-configuration/121575 "2007-11-29T01:19:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![doug3](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/b3f665/32.png) [@doug3](https://www.ruby-forum.com/u/doug3)\
**Post date:** [November 29, 2007, 1:19am UTC](https://www.ruby-forum.com/t/rails-version-configuration/121575/1 "2007-11-29T01:19:43Z")

</div>

Greetings,

Is there a way to configure my rails application so that it will work  
with any rails version and not crap out when the hosting company  
arbitrarily upgrades to the next version of rails?

My environment.rb file (for a deployed application) contained the  
following line:

# Specifies gem version of Rails to use when vendor/rails is not present

RAILS\_GEM\_VERSION = ‘1.2.5’ unless defined? RAILS\_GEM\_VERSION

This of course results in an application that will not start until the  
version number is corrected.

Thanks,

Doug

---

<div class="post-metadata">

**Author:** ![doug3](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/b3f665/32.png) [@doug3](https://www.ruby-forum.com/u/doug3)\
**Post date:** [November 29, 2007, 1:32am UTC](https://www.ruby-forum.com/t/rails-version-configuration/121575/2 "2007-11-29T01:32:22Z")

</div>

Yes, there are two ways. Best is if you can freeze your own version  
so your hosts can’t kill you with unannounced upgrades. If that is  
not an option in your particular configuration then you can comment  
out the line in enviroment.rb. If you take option two be aware that  
upgrades may break your app in odd ways, so you’ll want to stay on top  
of things as new versions come out.

Good Luck,  
Rob

---

<div class="post-metadata">

**Author:** ![doug3](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/b3f665/32.png) [@doug3](https://www.ruby-forum.com/u/doug3)\
**Post date:** [November 29, 2007, 1:41am UTC](https://www.ruby-forum.com/t/rails-version-configuration/121575/3 "2007-11-29T01:41:06Z")

</div>

Rob K. wrote:

> Yes, there are two ways. Best is if you can freeze your own version  
> so your hosts can’t kill you with unannounced upgrades. If that is  
> not an option in your particular configuration then you can comment  
> out the line in enviroment.rb. If you take option two be aware that  
> upgrades may break your app in odd ways, so you’ll want to stay on top  
> of things as new versions come out.
> 
> Good Luck,  
> Rob

Thanks Rob. I’ll give it a try.

---

<div class="post-metadata">

**Author:** ![doug3](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/b3f665/32.png) [@doug3](https://www.ruby-forum.com/u/doug3)\
**Post date:** [November 29, 2007, 5:29pm UTC](https://www.ruby-forum.com/t/rails-version-configuration/121575/4 "2007-11-29T17:29:54Z")

</div>

On Nov 28, 2007 6:19 PM, Doug M. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Is there a way to configure my rails application so that it will work  
> with any rails version and not crap out when the hosting company  
> arbitrarily upgrades to the next version of rails?

Just tell them to never run `gem cleanup`. There’s no harm in having  
97698723893 versions of Rails installed since you control the version  
your app uses in your config.rb.

–  
Greg D.  
[http://destiney.com/](http://destiney.com/)
