# Tell Rails which version of gems to use

**URL:** <https://www.ruby-forum.com/t/tell-rails-which-version-of-gems-to-use/92385>\
**Category:** Rails\
**Created:** [April 18, 2007, 10:56pm UTC](https://www.ruby-forum.com/t/tell-rails-which-version-of-gems-to-use/92385 "2007-04-18T22:56:25Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![blakeage](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/b38774/32.png) [@blakeage](https://www.ruby-forum.com/u/blakeage)\
**Post date:** [April 18, 2007, 10:56pm UTC](https://www.ruby-forum.com/t/tell-rails-which-version-of-gems-to-use/92385/1 "2007-04-18T22:56:25Z")

</div>

How do you tell Rails what version of gems to use?

For example, I have active record 1.14.2, 1.14.4, 1.15.1, and 1.15.3  
installed. 1.15.1 is actually what is used when I browse the website.  
I want it to use 1.15.3…

The same goes for active support as well.

Thx.

---

<div class="post-metadata">

**Author:** ![blakeage](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/b38774/32.png) [@blakeage](https://www.ruby-forum.com/u/blakeage)\
**Post date:** [April 18, 2007, 11:18pm UTC](https://www.ruby-forum.com/t/tell-rails-which-version-of-gems-to-use/92385/2 "2007-04-18T23:18:07Z")

</div>

> How do you tell Rails what version of gems to use?
> 
> For example, I have active record 1.14.2, 1.14.4, 1.15.1, and 1.15.3  
> installed. 1.15.1 is actually what is used when I browse the website.  
> I want it to use 1.15.3…
> 
> The same goes for active support as well.

In config/environment.rb…

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

RAILS\_GEM\_VERSION = ‘1.1.6’

Pick the rails version that corresponds to the “sub versions” you want  
to  
use…

-philip

---

<div class="post-metadata">

**Author:** ![blakeage](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/b38774/32.png) [@blakeage](https://www.ruby-forum.com/u/blakeage)\
**Post date:** [April 18, 2007, 11:18pm UTC](https://www.ruby-forum.com/t/tell-rails-which-version-of-gems-to-use/92385/3 "2007-04-18T23:18:58Z")

</div>

Blake M. wrote:

> How do you tell Rails what version of gems to use?
> 
> For example, I have active record 1.14.2, 1.14.4, 1.15.1, and 1.15.3  
> installed. 1.15.1 is actually what is used when I browse the website.  
> I want it to use 1.15.3…
> 
> The same goes for active support as well.

You shouldn’t mix and match various modules for Rails, since a Rails  
release is tested as a coherent set of version-compatible modules. But  
you can do what you want by setting the version of the Rails gem to use.  
In config/environment.rb there is a line near the top that sets the  
RAILS\_GEM\_VERSION constant. Change that to the version of Rails you  
want.

–  
Josh S.  
[http://blog.hasmanythrough.com](http://blog.hasmanythrough.com)

---

<div class="post-metadata">

**Author:** ![blakeage](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/b38774/32.png) [@blakeage](https://www.ruby-forum.com/u/blakeage)\
**Post date:** [April 18, 2007, 11:27pm UTC](https://www.ruby-forum.com/t/tell-rails-which-version-of-gems-to-use/92385/4 "2007-04-18T23:27:30Z")

</div>

> You shouldn’t mix and match various modules for Rails, since a Rails  
> release is tested as a coherent set of version-compatible modules. But  
> you can do what you want by setting the version of the Rails gem to use.  
> In config/environment.rb there is a line near the top that sets the  
> RAILS\_GEM\_VERSION constant. Change that to the version of Rails you  
> want.  
> So the gems it uses is determined by the rails gem dependencies? I just  
> wondered because I’m rolling Rails 1.2.1, somehow got active record  
> 1.15.3, but Rails 1.2.1 uses 1.15.1. Maybe I “accidentally” updated  
> active record : / itself.
