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.

133_add_hack_for_rubygems_gt_1_5_compatibility.patch

Thibaut Deloffre, 2011-02-15 05:18 pm

Download (1.6 kB)

 
b/config/environment.rb
7 7
# Specifies gem version of Rails to use when vendor/rails is not present
8 8
RAILS_GEM_VERSION = '2.3.5' unless defined? RAILS_GEM_VERSION
9 9

  
10

  
11
#Needed to use script/console with patch above
12
require 'rubygems'
13

  
14
#This is for the deprecation warning on older rubygem versions on version_requirements
15
module Rails
16
    #See lib/gems/1.8/gems/rails-2.3.5/lib/rails/gem_dependency.rb
17
    class GemDependency < Gem::Dependency
18
      def dependencies
19
        return [] if framework_gem?
20
        return [] unless installed?
21
        specification.dependencies.reject do |dependency|
22
          dependency.type == :development
23
        end.map do |dependency|
24
          GemDependency.new(dependency.name,
25
                            :requirement => (dependency.respond_to?(:requirement) ?
26
                             dependency.requirement :
27
                             dependency.version_requirements))
28
        end
29
      end
30

  
31
      if method_defined?(:requirement)
32
        #rubygem > 1.5
33
        def requirement
34
          req = super
35
          req unless req == Gem::Requirement.default
36
        end
37
      else
38
        #rubygem < 1.5
39
        def requirement
40
          req = version_requirements
41
          req unless req == Gem::Requirement.default
42
        end
43
      end
44
    end
45
end
46

  
10 47
# Bootstrap the Rails environment, frameworks, and default configuration
11 48
require File.join(File.dirname(__FILE__), 'boot')
12 49