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

前端 未结 5 1974
孤独总比滥情好
孤独总比滥情好 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:21

    Update: In addition to the @uxp answer, if you running this command on a Mac running Catalina, there is a small change in command, you need to add -n.

    So the command would be sudo gem update --system -n 1.8.25

    0 讨论(0)
  • 2020-12-04 06:24

    for rvm users,

    rvm install rubygems 1.8.2 --force
    
    0 讨论(0)
  • 2020-12-04 06:26

    This helped me: http://djellemah.com/blog/2013/02/27/rails-23-with-ruby-20/

    I did this in combination with gem update --system 1.8.25, which might not be needed for your case.

    0 讨论(0)
  • 2020-12-04 06:28

    Another way to do this is to install slimgems: gem install slimgems. This is a drop-in fork of RubyGems that works better with old versions.

    0 讨论(0)
  • 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.

    0 讨论(0)
提交回复
热议问题