问题
When I type
gem install sass
I get the following error message
C:>gem install compass ERROR: Could not find a valid gem 'compass' (>= 0), here is why: Unable to download data from https://rubygems.org/ - SSL_connect retur ned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed ( https://rubygems.org/latest_specs.4.8.gz)
回答1:
Use http
instead of https
gem sources --remove https://rubygems.org/
gem sources -a http://rubygems.org/
回答2:
I have experienced the same symptoms on Win7, Ruby 2.1.5 64bit - different gem, but same error message.
In my case, I had to install a new root certificate for rubygems, this link describes how:
https://gist.github.com/luislavena/f064211759ee0f806c88
The reason is that the ruby installation contains its own set of root certificates which are used when establishing secure connection with rubygems.org - but the certificate has since been changed on the server - so none of the root certificates that comes with this ruby installer can validate the server certificate. That is why you need to update the root certificate.
回答3:
According to this post : SSL Error When installing rubygems, Unable to pull data from 'https://rubygems.org/
Goto link http://rubygems.org/pages/download
Download the latest zip file
Unzip it
run "ruby setup.rb" in unzipped folder
now run gem install command
回答4:
TL;DR Apply the official fix:
- Download https://rubygems.org/downloads/rubygems-update-2.6.7.gem
Run:
gem install --local rubygems-update-2.6.7.gem update_rubygems --no-ri --no-rdoc gem uninstall rubygems-update -x
Long version
See http://guides.rubygems.org/ssl-certificate-update/ .
Basically it adds GlobalSignRootCA. Very easy to apply, unfortunately hard to google though.
回答5:
I also noticed issues with rubygems.org yesterday (in one environment), but your error almost sounds like an issue with a newly-installed Ruby and its SSL integration/configuration (having it locate SSL during installation, as well as the necessary certificates).
You might check out:
SSL Error When installing rubygems, Unable to pull data from 'https://rubygems.org/
But if that doesn't help I recommend continued searching, as this seems to be a common problem area.
回答6:
I fix the problem using this method:
Go to rubygems.org and install a fresh rubygems gem
Use the following approach: http://puu.sh/dKilg/78ccee17b6.png
http://help.rubygems.org/discussions/problems/19761-could-not-find-a-valid-gem
回答7:
what rails do you use??
I think your problem is the version of rails.
I use:
gem 'rails', '4.1.4'
gem 'sass-rails', '~> 4.0.3'
Some times https://rubygems.org is the problem I need to change for http://rubygems.org, I think the problems is for proxy.
来源:https://stackoverflow.com/questions/27260919/gem-install-cannot-download-from-rubygems-org