Ruby on Rails, could not find a valid gem 'rails'

前端 未结 5 1556
失恋的感觉
失恋的感觉 2021-01-30 23:32

I installed ruby and updated ruby gems, now I want to download rails 3.2.13. I write gem install rails -v 3.2.13 (I need this version) I have this error

ERROR:         


        
相关标签:
5条回答
  • 2021-01-31 00:04

    see if you can get this to work "wget rubygems.org/downloads/rails-3.2.13.gem"

    That worked for me, but Vimsha did not explain how to install the gem once you've downloaded it. It's quite easy:

    gem install rails-3.2.13.gem
    

    installs the gem and other gems that it depends on.

    This is where I got that information from:

    Installing Ruby Gems manually

    0 讨论(0)
  • 2021-01-31 00:11

    The answer and methodology can be found on http://guides.rubygems.org/ssl-certificate-update/

    Skip to "INSTALLING USING UPDATE PACKAGES (NEW)" and follow the instructions

    Newest RubyGem can be found at https://rubygems.org/pages/download

    0 讨论(0)
  • 2021-01-31 00:17

    I had a similiar error.

    Try in your Gemfile:

    source 'http://rubygems.org'
    

    Instead of:

    source 'https://rubygems.org'
    

    That solved my problem...

    0 讨论(0)
  • 2021-01-31 00:22

    I had the same problem but turns out I had a proxy setup but I was trying to download gems from a proxyless network

    First, Detect if you have any proxy setup. Do

    env | grep -i proxy
    

    If this command prints something on STDOUT on the terminal e.g. in my case

    http_proxy=http://proxy.abcde.ac.za:80/
    https_proxy=https://proxy.abcde.ac.za:80/
    

    Do

    unset http_proxy
    unset https_proxy
    

    This unsets the proxy environment variables to null so when you do env | grep -i proxy there should be no output.

    Now run

    gem install [gemname]
    
    0 讨论(0)
  • 2021-01-31 00:23

    do this:

    gem sources -a http://rubygems.org
    

    then answer y for

    Do you want to add this insecure source? [yn]
    

    lastly,

    gem install rails
    

    hope that helps :)

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