This project is archived and is in readonly mode.

#2620 ✓wontfix

config.gem ignores version

Reported by ticktricktrack | May 7th, 2009 @ 03:46 PM | in 2.x

Expected: rails should not allow the server to start if gem versions do not match the ones specified via config.gem

What happened

  1. added config.gem "rails",:version => "2.2.2" to config/environments/development.rb, my rails version is 2.3.2, no others installed
  2. script/server
  3. server started as usual

variation :version => ">= 2.9.2", same result

my versions

ubuntu 9.04 64bit ruby 1.9.1p0 rails 2.3.2 gem 1.3.3

Comments and changes to this ticket

  • Frederick Cheung

    Frederick Cheung May 7th, 2009 @ 09:35 PM

    You can't use rails config.gem stuff to specify the version of rails to load - it's all a bit chicken an egg as by the time you're running that a version of rails has already been picked and booted.

  • ticktricktrack

    ticktricktrack May 8th, 2009 @ 07:27 AM

    I get that, but I thought that if would check the already loaded versions against the config.gem defined ones.

  • Matt Jones

    Matt Jones May 10th, 2009 @ 11:38 PM

    • State changed from “new” to “wontfix”

    The core Rails gems are going to be detected as loaded before config.gem runs, so the current code doesn't even try to do anything with them.

    You should use the RAILS_GEM_VERSION constant (in environment.rb) to indicate what version you need.

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href=""></a>