Forum: Ruby on Rails How to use a freshly updated Rails gem?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
460ead051b49c0b2a8e45e46252d4bda?d=identicon&s=25 Tom Ha (tom)
on 2009-03-18 15:05
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"

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
81b61875e41eaa58887543635d556fca?d=identicon&s=25 Frederick Cheung (Guest)
on 2009-03-18 15:14
(Received via mailing list)
On Mar 18, 2:05 pm, Tom Ha <rails-mailing-l...@andreas-s.net> 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
Aafa8848c4b764f080b1b31a51eab73d?d=identicon&s=25 Phlip (Guest)
on 2009-03-18 15:20
(Received via mailing list)
> 2. in environment.rb set: "RAILS_GEM_VERSION = '2.3.2' unless defined?
> RAILS_GEM_VERSION"

rake rails:update

then run all your tests... (-;
460ead051b49c0b2a8e45e46252d4bda?d=identicon&s=25 Tom Ha (tom)
on 2009-03-18 15:21
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?)
460ead051b49c0b2a8e45e46252d4bda?d=identicon&s=25 Tom Ha (tom)
on 2009-03-18 15:23
PS: "rake rails:update" unfortunately didn't change the situation...
460ead051b49c0b2a8e45e46252d4bda?d=identicon&s=25 Tom Ha (tom)
on 2009-03-18 16:17
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!
81b61875e41eaa58887543635d556fca?d=identicon&s=25 Frederick Cheung (Guest)
on 2009-03-18 16:26
(Received via mailing list)
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
This topic is locked and can not be replied to.