gem install error, index not found, ruby on rails

前端 未结 7 408
礼貌的吻别
礼貌的吻别 2021-01-25 10:30

Problem: Cannot install any gem, any type. But I want to install riddle if that matters.

When I run sudo gem install \"gem_name\" I get the following error:

相关标签:
7条回答
  • 2021-01-25 11:05

    1) Here is the answer!!!! - slow connection

    2) Solution - move to a new connection.

    - This might not affect people in the 1st world, but I live in China and this was a huge problem as few people seem to have experienced this.

    Basically the error means that the connection is to slow and gives up saying no index found. But there is not documentation or help out there on this, except for a few posts about changing gem sources, and MERB causing problems, but all that failed for me.

    0 讨论(0)
  • 2021-01-25 11:05

    I was having the same problem and ran the following:

    gem env
    

    And saw that I had the following sources in my rubygems configuration:

    • http://gems.rubyforge.org
    • http://gems.rubyonrails.org
    • http://gems.github.com

    Based on other answers I've seen here and on the web I decided to remove the rubyonrails.org reference:

    sudo gem sources -r http://gems.rubyonrails.org
    

    I was then able to install the gem I was trying to get without the RubyGems 1.2+ index error.

    So I'd suggest trimming your list of sources down to just rubyforge and github and then trying to install the gem you want.

    0 讨论(0)
  • 2021-01-25 11:09

    I solved this problem by

    rm -rf ~/.gem
    

    And then run "gem install" again

    0 讨论(0)
  • 2021-01-25 11:10

    Check your sources

    gem sources
    

    rebuild index for affected sources, e.g.

    gem generate_index http://gems.rubyforge.org
    
    0 讨论(0)
  • 2021-01-25 11:22

    You are running an old RubyGems version. Upgrade to the latest RubyGems 1.3.x branch.

    $ rubygems update --self
    

    If it doesn't work (RubyGems 1.2.0 has a weird bug that prevents --self update) then install rubygems_update

    $ wget http://rubyforge.org/frs/download.php/60717/rubygems-update-1.3.5.gem
    $ gem install rubygems-update-1.3.5.gem
    $ update_rubygems
    

    Use sudo if your os requires it.

    0 讨论(0)
  • 2021-01-25 11:22

    Could be a daft entry in /etc/hosts...

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