Hola
Hola

Reputation: 165

Why would a Rails application explicitly declare config.gem 'rails' in environment.rb?

A sample application I was looking at has this in environment.rb:

  config.gem 'rails'

Is this redundant code or is there likely to be a reason the programmer did this?

Upvotes: 1

Views: 672

Answers (2)

Daniel Vandersluis
Daniel Vandersluis

Reputation: 94304

I guess you could use that if you had multiple versions of the Rails gem, and didn't freeze Rails into your application, so you could do something like

config.gem 'rails', :version => 2.2.2

But otherwise, it's redundant.

Upvotes: 2

Jim Puls
Jim Puls

Reputation: 81142

It's redundant code.

Upvotes: 2

Related Questions