Gem error for installation

I am trying to install rails, but I encountered the following error.

Does anyone know how to solve it?

C:\Users\Utilisateur>gem -v
2.0.14

C:\Users\Utilisateur>gem install rails
ERROR:  Could not find a valid gem 'rails' (>= 0), here is why:
          Unable to download data from https://rubygems.org/ - no such name (htt
ps://rubygems.org/latest_specs.4.8.gz)

C:\Users\Utilisateur>gem install rails --source http://rubygems.org
ERROR:  Could not find a valid gem 'rails' (>= 0), here is why:
          Unable to download data from https://rubygems.org/ - no such name (htt
ps://rubygems.org/latest_specs.4.8.gz)
          Unable to download data from http://rubygems.org/ - no such name (http
://rubygems.org/latest_specs.4.8.gz)
+4
source share
4 answers

I had the same problem, but I started "Start command line with Ruby" as an administrator and tried gem install railsand it worked.

+1
source

First try updating your ruby ​​gems.

gem update --system

The problem is most likely related to your internet connection.

If you see this problem again, try

gem install rails --source http://rubygems.org

You can add a non https source forever, like this

gem sources -a http://rubygems.org
Do you want to add this insecure source? [yn]y

I want to give you one more tip:

. , UNIXy. ubuntu .

+13

- . sudo http_proxy = http://host:port gem install rails.

+2

"gem install" root, . 'sudo', .

, "gem" .

0

Source: https://habr.com/ru/post/1536265/


All Articles