Ruby DevKit Unable to Download Date from Rubygens.org - ruby

I've installed the ruby devkit on Windows 7 but it's unable to install json using the following command:
gem install json --platform=ruby
I'm getting this error:
ERROR: Could not find a valid gem 'json' (>= 0), here is why:
Unable to download data from https://rubygems.org/ - SSL_connect returned=1 errno=0 state=SSLv2/v3 read server hello A:
unknown protocol (https://api.rubygems.org/specs.4.8.gz)
I'm on ruby 2.3.1p112 with RubyGems 2.5.1.

If you have a Gemfile, change the first line in Gemfile from https to http, it should do the trick.
Also, you can install gems global by creating a Gemfile and running bundle install from the directory the Gemfile is created. So, instead of using the gem install command, create a Gemfile and run bundle install in it.
This is the original
source 'https://rubygems.org'
gem 'test'
Change to
source 'http://rubygems.org'
gem 'test'
If you don't, you can pass the -s option to gem install and specify the url to http://rubygems.org

Related

Getting error while installing sass

I am trying to install sass on my Windows 10 PC using cli by typing command.
gem install sass
But after little delay it throws below error.
ERROR: Could not find a valid gem 'sass' (>= 0), here is why: Unable to download data from https://rubygems.org/ - timed out (https://api.rubygems.org/specs.4.8.gz)
Ruby is installed in my PC version is:
ruby 2.5.0p0 (2017-12-25 revision 61468) [x64-mingw32]
Gem version is 2.7.3
Try installing all the sources first by running the below command:
gem sources -a http://rubygems.org/
If the error persists, try removing the proxy. Your proxy server might be blocking the request.

gem install sass error

I am trying to install sass and I tried ruby installer. I am getting the error as follow.Please anyone help.
C:\Ruby23-x64>gem install sass
ERROR: Could not find a valid gem 'sass' (>= 0), here is why:
Unable to download data from https://rubygems.org/ - SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (https://api.rubygems.org/specs.4.8.gz)
gem install by default uses https://rubygems.org/ as it's source for gems, but you can specify the source using --source option and give a non-SSL source to install like following:
gem install sass --source http://rubygems.org/

Couldn't install local gem

I'm trying to install a gem that i'm developing from local.
gem install mygem.gemspec
It produces an error:
ERROR: Could not find a valid gem 'mygem.gemspec' (>= 0) in any repository
I can't find any error why it doesn't work, what might be a problem here?
You don’t install the .gemspec file, you use that to build the gem, and then install the resulting gem.
Something like:
$ gem build mygem.gemspec
Successfully built RubyGem
Name: mygem
Version: 1.0.0
File: mygem-1.0.0.gem
and then:
$ gem install mygem-1.0.0.gem
Successfully installed mygem-1.0.0
1 gem installed

ruby gem on windows 10 not working

I am trying to install sass with ruby on my windows machine gem install sass but it is not working.
I get the following error:
Unable to download data from https://rubygems.org/ - SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (https://api.rubygems.org/specs.4.8.gz)
After googling around I found this workaround:
https://gist.github.com/luislavena/f064211759ee0f806c88
The thing is that I already have an AddTrustExternalCARoot-2048.pem in my ssl_certs directory.
gem --version shows 2.4.5.1
I am using windows 10 and downloaded the installer from ruby website: http://rubyinstaller.org/downloads/
ruby -v shows ruby 2.2.5p319 (2016-04-26 revision 54774) [i386-mingw32]
What can I do?
You can go into your gemfile and change the source to http://rubygems.org (lose the https://).

Remote gem is not working

I got this when I tried to update gems:
LJ$ gem update --system
ERROR: While executing gem ... (Gem::RemoteFetcher::UnknownHostError)
no such name
and this when trying to install a gem:
LJ$ gem install mongrel
ERROR: Could not find a valid gem 'mongrel' (>= 0), here is why:
Unable to download data from https://rubygems.org/ - no such name
What's the problem?

Resources