Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

config.gem ignores version

#2620

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

Reported by ticktricktrack · May 7th, 2009 @ 03:46 PM

State: wontfix
Milestone: 2.x
Assigned to: nobody
Importance: none

Activity

  1. Frederick Cheung
    Frederick Cheung

    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.

    May 7th, 2009 @ 09:35 PM

  2. ticktricktrack
    ticktricktrack

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

    May 8th, 2009 @ 07:27 AM

  3. Matt Jones
    Matt Jones
    • 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.

    May 10th, 2009 @ 11:38 PM