Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gem error to install

I try to install rails but I am faced to the following error.

Has somebody any idea how to resolve 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)
like image 991
Alexis G Avatar asked Dec 07 '22 02:12

Alexis G


1 Answers

First try to update ruby gems.

gem update --system

The issue most likely is with your internet connection.

If you see this issue again, try

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

You can add the not https source permanently 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:

Don't develop rails on windows. Ruby and rails and many gems are very UNIXy in their ways. Install virtualbox and ubuntu on a virtual machine and run you development for there.

like image 194
Andreas Lyngstad Avatar answered Dec 20 '22 18:12

Andreas Lyngstad