This project is archived and is in readonly mode.
Loading environment fails with an outdated version of RubyGems while using config.gem "some_gem"
-
jeff
- Tag set to 2.1
+1
it would be nice to have some kind of warning or failure if rails is incompatible with gem version < x
-
David Lowenfels
+1 rails definitely needs a patch to fix this... it is terrible to have things fail with a cryptic error
-
David Lowenfels
Simple fix: rails already was requiring rubygems >= 0.9.4.
This patch makes it require rubygems >= 1.1.1
-
David Lowenfels
I don't see the attachment from my last comment. Can only admins see it??
I'm attaching it again, and including in this comment. Sorry if it ends up being a repeat.
From ec3108863e6fa7613fb251f1dd916c9a3e668665 Mon Sep 17 00:00:00 2001 From: David Lowenfels Date: Tue, 8 Jul 2008 18:34:20 -0700 Subject: [PATCH] requiring rubygems version 1.1.1 --- railties/environments/boot.rb | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/railties/environments/boot.rb b/railties/environments/boot.rb index cd21fb9..4bb0e06 100644 --- a/railties/environments/boot.rb +++ b/railties/environments/boot.rb @@ -82,17 +82,17 @@ module Rails def load_rubygems require 'rubygems' - - unless rubygems_version >= '0.9.4' - $stderr.puts %(Rails requires RubyGems >= 0.9.4 (you have #{rubygems_version}). Please `gem update --system` and try again.) + min_version = '1.1.1' + unless rubygems_version >= min_version + $stderr.puts %Q(Rails requires RubyGems >= #{min_version} (you have #{rubygems_version}). Please `gem update --system` and try again.) exit 1 end rescue LoadError - $stderr.puts %(Rails requires RubyGems >= 0.9.4. Please install RubyGems and try again: http://rubygems.rubyforge.org) + $stderr.puts %Q(Rails requires RubyGems >= #{min_version}. Please install RubyGems and try again: http://rubygems.rubyforge.org) exit 1 -
Jeremy Kemper
- Milestone set to 2.1.1
- Assigned user set to Rick
- State changed from new to open
-
Clemens Kofler
+1
I had that problem as well a few days ago.
Question: Would it be possible to have something similar to rake gems:install for RubyGems itself? And would that make sense?
-
Jeremy Kemper
The initializer could do a stricter version check. Then boot.rb doesn't have to be updated for all apps (the rubygems version requirement in boot.rb is just enough to get Rails off the ground).
-
Ben Oakes
Thanks, everyone, for your work on this. I really appreciate that this will save someone some grief down the road!
-
Steve Verlinden
Thank you! I saw this error today on Linux (with RubyGems 0.9.4), this ticket really help me to quickly fix this.
-
David Lowenfels
@jeremy: any way you can edit the comments to remove my email address (spambait) from my "July 8th, 2008 @ 08:50 PM" comment? Thx!
-
Glenn Powell
I'm not sure if my problem is related to (or caused by) this fix, but now for some reason when I run any script/generate call, I get undefined method errors spawning from the lib files that I require in my environment.rb file.
For instance I have these lines in my environment.rb:
- Bootstrap the Rails environment, frameworks, and default configuration
require File.join(File.dirname(__FILE__), 'boot')
require 'locale/custom'
So when the I call 'ruby script/generate mailer postoffice', the process loads my environment.rb (apparently before loading the rest of Rails core). Because when it gets to my custom require, it fails saying it can't find the Rails core modules and classes referenced in the required file. Specifically: 'backend=' for I18n:Module.
Why wouldn't it have loaded the Rails core files at this point? And why does the script/server call work just fine?
-
Jeff Kreeftmeijer
Automatic cleanup of spam.
