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

前端 未结 5 1570
失恋的感觉
失恋的感觉 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: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]
    

提交回复
热议问题