# How to use a freshly updated Rails gem?

**URL:** <https://www.ruby-forum.com/t/how-to-use-a-freshly-updated-rails-gem/163238>\
**Category:** Rails\
**Created:** [March 18, 2009, 3:05pm UTC](https://www.ruby-forum.com/t/how-to-use-a-freshly-updated-rails-gem/163238 "2009-03-18T15:05:15Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![tharrisx](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/e19adc/32.png) [@tharrisx](https://www.ruby-forum.com/u/tharrisx)\
**Post date:** [March 18, 2009, 3:05pm UTC](https://www.ruby-forum.com/t/how-to-use-a-freshly-updated-rails-gem/163238/1 "2009-03-18T15:05:15Z")

</div>

Hi there,

How do IÂ make my app pick up the new Rails gem that I have just updated?

I have:

1. just updated rails from version 2.1.0 to version 2.3.2 (console:  
“rails -v” → “Rails 2.3.2”)
2. in environment.rb set: “RAILS\_GEM\_VERSION = ‘2.3.2’ unless defined?  
RAILS\_GEM\_VERSION”
3. restarted the server

Result:

- The Console in Eclipse tells me “=\> Rails 2.1.0 application started on  
[http://127.0.0.1:3000](http://127.0.0.1:3000)”

Even if I  
a) totally uncomment “RAILS\_GEM\_VERSION = ‘2.3.2’ unless defined?  
RAILS\_GEM\_VERSION” (in environment.rb), or  
b) uncomment only “unless defined? RAILS\_GEM\_VERSION” (in  
environment.rb),  
Eclipse tells me the same thing (after having restarted the server).

Plus: I haven’t found any system environment variable called “Rails” (or  
similar), using “printenv” in the Linux console.

What’s going on here?  
How can I make my app use the new 2.3.2 rails gem?

Thanks a lot for your help!  
Tom

---

<div class="post-metadata">

**Author:** ![tharrisx](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/e19adc/32.png) [@tharrisx](https://www.ruby-forum.com/u/tharrisx)\
**Post date:** [March 18, 2009, 3:14pm UTC](https://www.ruby-forum.com/t/how-to-use-a-freshly-updated-rails-gem/163238/2 "2009-03-18T15:14:43Z")

</div>

On Mar 18, 2:05 pm, Tom Ha [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Hi there,
> 
> How do I make my app pick up the new Rails gem that I have just updated?

Is rails vendored into your app ? (ie does vendor/rails exist ?)

Fred

---

<div class="post-metadata">

**Author:** ![tharrisx](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/e19adc/32.png) [@tharrisx](https://www.ruby-forum.com/u/tharrisx)\
**Post date:** [March 18, 2009, 3:21pm UTC](https://www.ruby-forum.com/t/how-to-use-a-freshly-updated-rails-gem/163238/3 "2009-03-18T15:21:18Z")

</div>

Yes, I have a “rails” folder in “vendor”.

What’s the conclusion from this?

(And: should I have it elsewhere instead? If yes, where and why? And how  
would I do that?)

---

<div class="post-metadata">

**Author:** ![tharrisx](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/e19adc/32.png) [@tharrisx](https://www.ruby-forum.com/u/tharrisx)\
**Post date:** [March 18, 2009, 3:20pm UTC](https://www.ruby-forum.com/t/how-to-use-a-freshly-updated-rails-gem/163238/4 "2009-03-18T15:20:01Z")

</div>

> 1. in environment.rb set: “RAILS\_GEM\_VERSION = ‘2.3.2’ unless defined?  
> RAILS\_GEM\_VERSION”

rake rails:update

then run all your tests… (-;

---

<div class="post-metadata">

**Author:** ![tharrisx](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/e19adc/32.png) [@tharrisx](https://www.ruby-forum.com/u/tharrisx)\
**Post date:** [March 18, 2009, 3:23pm UTC](https://www.ruby-forum.com/t/how-to-use-a-freshly-updated-rails-gem/163238/5 "2009-03-18T15:23:22Z")

</div>

PS:Â “rake rails:update” unfortunately didn’t change the situation…

---

<div class="post-metadata">

**Author:** ![tharrisx](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/e19adc/32.png) [@tharrisx](https://www.ruby-forum.com/u/tharrisx)\
**Post date:** [March 18, 2009, 4:17pm UTC](https://www.ruby-forum.com/t/how-to-use-a-freshly-updated-rails-gem/163238/6 "2009-03-18T16:17:09Z")

</div>

Ok, got it working, here’s what the problem was:

- you can have Rails either in “vendor” or elsewhere on your system,  
e.g. in “/usr/lib/ruby/gems/1.8/gems” (or in both places)
- the file config/boot.rb checks if there is a version in “vendor” and  
prefers this one over the one that’s NOT included in your app

In my case,

- I had different versions in both places, and
- the one in “vendor” was the old one, so I just deleted it and my app  
now picks up the newer/updated one in “/usr/lib/ruby/gems/1.8/gems”

Thanks for your hint, Fred!

---

<div class="post-metadata">

**Author:** ![tharrisx](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/e19adc/32.png) [@tharrisx](https://www.ruby-forum.com/u/tharrisx)\
**Post date:** [March 18, 2009, 4:26pm UTC](https://www.ruby-forum.com/t/how-to-use-a-freshly-updated-rails-gem/163238/7 "2009-03-18T16:26:06Z")

</div>

On 18 Mar 2009, at 14:21, Tom Ha wrote:

> Yes, I have a “rails” folder in “vendor”.
> 
> What’s the conclusion from this?  
> if you have such a folder then your app uses the version of rails in  
> there and ignores any installed gems (you don’t even need the gems  
> installed at all)

Fred
