This project is archived and is in readonly mode.
Rubygems 1.3.6 warning in Rails 2.3.5
-
Phillip Koebbe
Me, too.
I worked around it by adding
if Gem::VERSION >= "1.3.6" module Rails class GemDependency def requirement r = super (r == Gem::Requirement.default) ? nil : r end end end endbetween the bootstrap line and the initialization section of my environment.rb.
Peace.
-
Balazs Nagy
I don't think this problem should be fixed in a client code. Where's the 'invalid' button?
-
Phillip Koebbe
Oh, I don't either. I was just providing a way to work around the deprecation warning. It's quite obnoxious when running specs.
The solution is to do just what I did, but in gem_dependency.rb: replace the call to version_requirements with super. Unfortunately, I'm not in a position where I can make and test the patch as I am not set up to do that with Rails and I don't have the bandwidth to do it right now. For anyone who is already submitting patches to Rails, this is a no-brainer.
I just wanted to add what I could to the conversation.
To replicate, upgrade to rubygems 1.3.6. Anything you do in Rails, whether running a test or firing up script/server, should produce the warning. I've seen it on 2.3.4 and 2.3.5.
Peace.
-
Christoph Schiessl
I agree that this deprecation message is annoying and can confirm the fix suggested by Phillip Koebbe works as advertised. I'm trying to create a patch for this - however this is my first attempt to fix a bug in Rails. So, don't expect too much from my end.
-
Christoph Schiessl
I'm curious what you guys think about my first patch...
-
Prem Sichanugrist (sikachu)
- Assigned user set to Jeremy Kemper
- State changed from new to verified
- Milestone set to 2.3.6
I can confirm this behavior, and the patch looks fine.
-
Jeremy Kemper
Does the patch work with older rubygems too?
-
Prem Sichanugrist (sikachu)
My fault, the patch doesn't work with 1.3.5. Thanks to point that out.
-
Prem Sichanugrist (sikachu)
Jeremy, I've modified Christoph's patch with backward compatibility with
gem<= 1.3.5. It's kind of hackish though, as it check theGem::Dependencyforrequirementmethod, which wasn't available until RubyGems 1.3.6Credit still goes to the original patcher :)
-
Repository
- State changed from verified to committed
(from [268c9040d5c3c7ed30f3923eee71a78eeece8a8a]) remove rubygems (version >= 1.3.6) deprecation message by replacing Gem::Dependency#version_requirements with Gem::Dependency#requirement
[#4026 Rubygems 1.3.6 warning in Rails 2.3.5 state:committed]
Signed-off-by: Prem Sichanugrist s@sikachu.com
Signed-off-by: Jeremy Kemper jeremy@bitsweat.net
http://github.com/rails/rails/commit/268c9040d5c3c7ed30f3923eee71a7... -
Christoph Schiessl
Cool! Thank you Prem for the quick response.
I wonder why backward compatibility with older version of rubygems is even required? Wouldn't it be sufficient to add rubygems 1.3.6 as requirement to the railties gemspec file?
Did anyone try this with rails 3.0.beta? I guess the core team is going merge all the 2-3-stable commits to master anyways before rails 3.0 is released, right?
-
Prem Sichanugrist (sikachu)
Chirstoph,
2-3-stableandmasteris really separate from each other now.master, in other word Rails 3, becoming more modular and lots of code and functionality has changed. It won't be merged together :)So, in my opinion, I would treat
masteras the next version of Rails, but2-3-stablewould be updated only if there's a known bug.Rails 3 already got this problem solved by using Bundler, so no need to fix it.
-
matt vs world
Quick question about the patch -- should the quoted "requirement" in line 119 actually be :requirement ?
I'm running ruby 1.9.1, rails 2.3.5, and rubygems 1.3.6, and the patch only works if, in that line, "requirement" is a symbol rather than a string. i.e., i still got the warnings until i made this additional change.
-
Prem Sichanugrist (sikachu)
@matt
Actually, Jeremy did some rewrite to the patch to make more appropriate. Please take a look at changelog :)
http://github.com/rails/rails/commit/268c9040d5c3c7ed30f3923eee71a7...
-
matt vs world
@prem:
Apologies, I last checked the ticket a few days ago, and didn't follow over to the changelog when I glanced at it yesterday! Guess I assumed the posted patch ended up being the final one... wups! It appears the committed patch includes changes which resolve my "should be a symbol" issue.
thanks!
-
Sardor
- Assigned user cleared.
I updated RubyGems nd I got warning like warning below when I wanted to start my server...
Warning: Gem::Dependency#version_requirements is deprecated and will be removed on or after August 2010. Use #requirementI tried to do with instruction in first lines, but I could not(
