undefined method `source_index' for Gem:Module (NoMethodError)

前端 未结 5 1986
孤独总比滥情好
孤独总比滥情好 2020-12-04 05:58

I\'m running a Rails 2.3.5 application and upon running script/server I am shown the following:

./script/../config/../vendor/rails/railties/lib/rails/gem_dep         


        
5条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-04 06:38

    I just ran into this problem myself while trying to upgrade an older Rails app from REE 1.8.7 to 1.9.3-p385. Oddly, Ruby 1.9.3-p327 works just fine. What it came down to was ruby-1.9.3-p385 had installed RubyGems version 2.0.2 for me, and 1.9.3-p327 has RubyGems v1.8.23 installed.

    Gem.source_index has been deprecated for a while, but since Rails 2.3 is not getting any updates except critical security patches, this will never get fixed. RubyGems v2.0 finally removed that method. Downgrade to any rubygems version prior to 2.0.0, like 1.8.25 to get the functionality back for now. You can get a compatible version using gem update --system 1.8.25.

    As a very important aside, Rails 2.3.5 needs to be updated to a minimum of 2.3.17. There are critical security vulnerabilities that open you up to some very nasty attacks. In the long term, upgrading to 3.x needs to be considered a very strong need.

提交回复
热议问题