Gem.source_index is deprecated, use Specification. Should I re-install Gem or Rails?

后端 未结 5 397
清歌不尽
清歌不尽 2020-12-02 12:39

I\'m learning RoR on Ubuntu 11. Got the following message when I was trying to generate an app. Did I install something incorrectly?

$ rails generate control         


        
相关标签:
5条回答
  • 2020-12-02 12:42

    The best way to solve this is:

    $ gem pristine --all --no-extensions
    

    This will rebuild all gems (excluding those with native extensions) and update their gemspecs. If you don't have any gems with native extensions or you didn't use any custom compile flags on those gems you can also omit the --no-extensions flag. Otherwise you'll have to build them seperately.

    0 讨论(0)
  • 2020-12-02 12:46

    I tried "sudo gem update". After that, I don't see the message "Gem.source_index is deprecated, use Specification..." anymore. Yay!

    0 讨论(0)
  • 2020-12-02 12:50

    rails -v = 2.2.2

    ruby -v = 1.8.7

    This link helps me.

    or simply do

    gem update --system 1.6.2
    
    0 讨论(0)
  • 2020-12-02 12:51

    Try this:

    sudo gem update bundler
    

    This will update bundler to most recent version (currently 1.0.15). This will not generate the warning or at least in my case this was the cause of the warning.

    0 讨论(0)
  • 2020-12-02 13:02

    This worked for me: downgrade rubygems:

    gem update --system 1.6.2
    

    found this advice at: Gem.source_index is deprecated, use Specification #34

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