ChiliProject is not maintained anymore. Please be advised that there will be no more updates.

We do not recommend that you setup new ChiliProject instances and we urge all existing users to migrate their data to a maintained system, e.g. Redmine. We will provide a migration script later. In the meantime, you can use the instructions by Christian Daehn.

Add hack for rubygems > 1.5 compatibility (Bug #133)


Added by Holger Just at 2011-02-03 10:18 am. Updated at 2011-03-02 09:21 am.


Status:Closed Start date:2011-02-03
Priority:High Due date:
Assignee:Holger Just % Done:

0%

Category:-
Target version:1.1.0 — Bell
Remote issue URL:http://www.redmine.org/issues/7516 Affected version:

Description

The version_requirements method in rubygems (which is used by Rails 2.3.5) was finaly removed in rubygems 1.5, after being deprecated for a long time.

There exists a hack for Rails applications which returns compatibility for rubygems 1.5 and removes the deprecation warning on older rubygem versions, available from the Rails ticket. See https://rails.lighthouseapp.com/projects/8994/tickets/4026-rubygems-136-warning-in-rails-235

This fix should be included into ChiliProject until we manage to upgrade to a newer Rails version.


133_add_hack_for_rubygems_gt_1_5_compatibility.patch (1.6 kB) Thibaut Deloffre, 2011-02-15 05:18 pm

FINAL_133_add_hack_for_rubygems_gt_1_5_compatibility.patch (1.6 kB) Thibaut Deloffre, 2011-02-15 05:44 pm


Related issues

related to Feature #216: Remove the rubygems hack from boot.rb Closed 2011-02-22

Associated revisions

Revision 28bbee15
Added by Thibaut Deloffre at 2011-02-22 02:51 pm

[#133] Provide workaround for rubygems 1.5 compatibility

Remove the deprecation warnings for version_requirements with rubygems < 1.5
and allow ChiliProject to run with rubygems >= 1.5.

Revision 261aca65
Added by Eric Davis at 2011-11-25 09:50 pm

Merge pull request #133 from schmidt/pulls/725/master

[#725] Compatibility check for jQuery availability (master)

History

Updated by Thibaut Deloffre at 2011-02-09 11:21 am

Hi,

I just send my pull request on github for this fix.

Bye,

Thibaut

Updated by Holger Just at 2011-02-09 11:42 am

Thibaut Deloffre wrote:

I just send my pull request on github for this fix.

Please always reference your pull request in the comment so we can actually find it again. Also you really should use feature branches. Please refer to Contribute_Code for more information.

Your Pull request is at https://github.com/chiliproject/chiliproject/pull/1.

  • Status changed from Open to Ready for review

Updated by Felix Schäfer at 2011-02-09 12:08 pm

That seems like a mouthful, another approach has been suggested in note 3 of the corresponding redmine bug report.

Thibault: are there any advantages to your method, or disadvantages to the shorter method linked above?

Updated by Thibaut Deloffre at 2011-02-09 02:48 pm

Holger Just wrote:

Thibaut Deloffre wrote:

I just send my pull request on github for this fix.

Please always reference your pull request in the comment so we can actually find it again. Also you really should use feature branches. Please refer to Contribute_Code for more information.

Your Pull request is at https://github.com/chiliproject/chiliproject/pull/1.

Oh, sorry...

I wont forget for the next time.

Updated by Thibaut Deloffre at 2011-02-09 02:53 pm

Felix Schäfer wrote:

That seems like a mouthful, another approach has been suggested in note 3 of the corresponding redmine bug report.

Thibault: are there any advantages to your method, or disadvantages to the shorter method linked above?

In fact, this method is exactly the same that you can find in new rails version.
I just overloaded existing rails methods.

Updated by Felix Schäfer at 2011-02-15 01:53 pm

OK, I don't care which one gets in as long as it works ;-) My rails-foo is a little low on that one though, so I'll let either Holger or Eric decide which one to pull in.

Updated by Thibaut Deloffre at 2011-02-15 03:19 pm

It seems that my code breaks script/console on some rails version.

I'm searching for a new workaround.

Updated by Thibaut Deloffre at 2011-02-15 05:18 pm

Re

A require was missing.
I attached my patch to this comment.

Bye

  • File 133_add_hack_for_rubygems_gt_1_5_compatibility.patch added

Updated by S C at 2011-02-15 05:41 pm

Changing Rails version to 2.3.11 would fix the problem. Just tested by changing the RAILS_GEM_VERSION and it doesn't seem to break.

Updated by Thibaut Deloffre at 2011-02-15 05:44 pm

Re

Thx to Simon Courtois who permit the final correction to bypass passenger error.

Bye.

  • File FINAL_133_add_hack_for_rubygems_gt_1_5_compatibility.patch added

Updated by S C at 2011-02-18 09:50 am

Did someone of the team tested it ?
It's a pretty important issue I think.

Updated by Felix Schäfer at 2011-02-20 06:02 pm

Simon COURTOIS wrote:

Did someone of the team tested it ?

As I said, I don't feel qualified enough :-) Eric, Holger?

Updated by Holger Just at 2011-02-21 10:47 am

I tested it and it works well. I'm a bit unsure though, if this is really the least invasive method. Gonna dig a bit through the rubygems code later...

Updated by Felix Schäfer at 2011-02-21 10:54 am

Holger Just wrote:

I tested it and it works well. I'm a bit unsure though, if this is really the least invasive method. Gonna dig a bit through the rubygems code later…

From what I gathered it mostly is the code rubygems used in 1.4 for backwards compatibility, so if it works, I'd keep it like that.

Updated by Thibaut Deloffre at 2011-02-21 11:50 am

Felix Schäfer wrote:

From what I gathered it mostly is the code rubygems used in 1.4 for backwards compatibility, so if it works, I'd keep it like that.

Yep, it is mostly rubygems code in this patch.

Imho, it'll be easier to maintain with this piece of code.

Updated by Eric Davis at 2011-02-21 11:22 pm

Holger, it's your call. I don't have rvm set up yet and I don't want to force all of my apps to Rubygems 1.5 yet.

Updated by Holger Just at 2011-02-21 11:28 pm

Gonna thoroughly test it tomorrow. But as I said, I think the patch is gonna be fine.

  • Assignee set to Holger Just

Updated by Holger Just at 2011-02-22 02:21 pm

Moved your patch into boot.rb but kept the structure the same. The hack has to be completely removed once we move to a newer Rails version (see #216)

  • Status changed from Ready for review to Closed

Updated by Eric Davis at 2011-02-27 10:16 pm

  • Subject changed from Add hack for rubygems > 1.5 compatibiity to Add hack for rubygems > 1.5 compatibility

Updated by Eric Davis at 2011-03-02 12:58 am

I'm not sure this is fully fixed. Works fine with the full Rails environment but some rake tasks are failing.

$ rake gems
(in /home/edavis/dev/chiliproject/core)
 - [F] rubytree 
rake aborted!
undefined method `version_requirements' for #<Gem::Dependency:0x9ade2fc>

(See full trace by running task with --trace)
$ gem --version
1.5.2

Full trace:

$ rake gems --trace
(in /home/edavis/dev/chiliproject/core)
** Invoke gems (first_time)
** Invoke gems:base (first_time)
** Execute gems:base
** Invoke environment (first_time)
** Execute environment
** Execute gems
 - [F] rubytree 
rake aborted!
undefined method `version_requirements' for #<Gem::Dependency:0x8b920c8>
/home/edavis/.rvm/gems/ree-1.8.7-2011.03/gems/rails-2.3.5/lib/rails/gem_dependency.rb:86:in `dependencies'
/home/edavis/.rvm/gems/ree-1.8.7-2011.03/gems/rails-2.3.5/lib/rails/gem_dependency.rb:83:in `map'
/home/edavis/.rvm/gems/ree-1.8.7-2011.03/gems/rails-2.3.5/lib/rails/gem_dependency.rb:83:in `dependencies'
/home/edavis/.rvm/gems/ree-1.8.7-2011.03/gems/rails-2.3.5/lib/tasks/gems.rake:77:in `print_gem_status'
/home/edavis/.rvm/gems/ree-1.8.7-2011.03/gems/rails-2.3.5/lib/tasks/gems.rake:4
/home/edavis/.rvm/gems/ree-1.8.7-2011.03/gems/rails-2.3.5/lib/tasks/gems.rake:3:in `each'
/home/edavis/.rvm/gems/ree-1.8.7-2011.03/gems/rails-2.3.5/lib/tasks/gems.rake:3
/home/edavis/.rvm/gems/ree-1.8.7-2011.03/gems/rake-0.8.7/lib/rake.rb:636:in `call'
/home/edavis/.rvm/gems/ree-1.8.7-2011.03/gems/rake-0.8.7/lib/rake.rb:636:in `execute'
/home/edavis/.rvm/gems/ree-1.8.7-2011.03/gems/rake-0.8.7/lib/rake.rb:631:in `each'
/home/edavis/.rvm/gems/ree-1.8.7-2011.03/gems/rake-0.8.7/lib/rake.rb:631:in `execute'
/home/edavis/.rvm/gems/ree-1.8.7-2011.03/gems/rake-0.8.7/lib/rake.rb:597:in `invoke_with_call_chain'
/home/edavis/.rvm/rubies/ree-1.8.7-2011.03/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/home/edavis/.rvm/gems/ree-1.8.7-2011.03/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'
/home/edavis/.rvm/gems/ree-1.8.7-2011.03/gems/rake-0.8.7/lib/rake.rb:583:in `invoke'
/home/edavis/.rvm/gems/ree-1.8.7-2011.03/gems/rake-0.8.7/lib/rake.rb:2051:in `invoke_task'
/home/edavis/.rvm/gems/ree-1.8.7-2011.03/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
/home/edavis/.rvm/gems/ree-1.8.7-2011.03/gems/rake-0.8.7/lib/rake.rb:2029:in `each'
/home/edavis/.rvm/gems/ree-1.8.7-2011.03/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
/home/edavis/.rvm/gems/ree-1.8.7-2011.03/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/home/edavis/.rvm/gems/ree-1.8.7-2011.03/gems/rake-0.8.7/lib/rake.rb:2023:in `top_level'
/home/edavis/.rvm/gems/ree-1.8.7-2011.03/gems/rake-0.8.7/lib/rake.rb:2001:in `run'
/home/edavis/.rvm/gems/ree-1.8.7-2011.03/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/home/edavis/.rvm/gems/ree-1.8.7-2011.03/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
/home/edavis/.rvm/gems/ree-1.8.7-2011.03/gems/rake-0.8.7/bin/rake:31
/home/edavis/.rvm/gems/ree-1.8.7-2011.03/bin/rake:19:in `load'
/home/edavis/.rvm/gems/ree-1.8.7-2011.03/bin/rake:19

Updated by Gregor Schmidt at 2011-03-02 07:49 am

I think, the safest bet, to fix this problem, still is updating to Rails 2.3.11. Also the newly released RubyGems 1.6 again deprecates loads of methods that will most probably affect old rails versions.

IMO, updating Rails should be the no. 1 focus for Chili 1.2.

Shouldn't this ticket be reopened or a new ticket be created to discuss your stack trace.

Updated by Gregor Schmidt at 2011-03-02 07:56 am

Ok, I just saw in #196, that you are aiming to include 2.3.11 support in 2.0. Thus, 1.2 should become new 2.0 and old 2.0 should become 3.0.

I think maintaining the hacks to run with current system dependencies like RubyGems or other things, that may not be fixed by bundling them with releases, as well as porting back Rails security fixes will not be feasible for half a year.

Updated by Thibaut Deloffre at 2011-03-02 09:09 am

Just to check, the final patch in attachment has been added to chili ?

Updated by Holger Just at 2011-03-02 09:16 am

Thibaut Deloffre wrote:

Just to check, the final patch in attachment has been added to chili ?

The gist of it. I moved it from environment.rb to boot.rb and added a few comments but kept the patch itself unchanged.

Updated by Thibaut Deloffre at 2011-03-02 09:21 am

Holger Just wrote:

Thibaut Deloffre wrote:

Just to check, the final patch in attachment has been added to chili ?

The gist of it. I moved it from environment.rb to boot.rb and added a few comments but kept the patch itself unchanged.

Ok, I'll check.

Also available in: Atom PDF