How to avoid gem update error in windows? - ruby

showing below error
C:\Ruby21>gem update
Updating installed gems
ERROR: While executing gem ... (Gem::RemoteFetcher::FetchError)
SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certif
icate verify failed (https://api.rubygems.org/specs.4.8.gz)
C:\Ruby21>
May be blocked by windows firewall.

Here's the fix to your problem.
I only had to follow these instructions.
Installing using update packages (NEW)
Now that RubyGems 1.8.x, 2.0.x, and 2.2.x have been released, you can manually
update to those versions.
First, download the proper version of RubyGems for your installation (e.g. if running version 1.8.28, download 1.8.30).
Note: To find the version of RubyGems you're using, run gem --version in the command line.
You can find download links at GitHub under
Releases.
Now, locate rubygems-update-X.Y.Z.gem where X.Y.Z will be the matching version of RubyGems that you need to update:
Running 1.8.x: download 1.8.30
Running 2.0.x: donwload 2.0.15
Running 2.2.x: download 2.2.3
Please download the file in a directory that you can later point to (e.g. the
root of your harddrive C:\)
Now, using your Command Prompt:
C:\>gem install --local
C:\rubygems-update-1.8.30.gem
C:\>update_rubygems --no-ri --no-rdoc
After this, gem --version should report the new update version.
You can now safely uninstall rubygems-update gem:
C:\>gem uninstall rubygems-update -x
Removing update_rubygems
Successfully uninstalled rubygems-update-2.2.3
After following these instructions, I was able to run gem update --system successfully.
I didn't have to implement the following set of instructions.
I think I was running gem version 2.4.4.

Related

SSL certificate verify failed error when trying to install gems

Im on OSX 10.10.5 and using RVM and ruby version 2.3.1. When i run gem install <gem_name> i get the following error
Unable to download data from https://rubygems.org/ - SSL_connect
returned=1 errno=0 state=error: certificate verify failed
(https://api.rubygems.org/specs.4.8.gz)
I tried with different versions of ruby but still get the same error. When i run the following command
rvm osx-ssl-certs status all
I get:
Certificates for /etc/openssl/cert.pem: Up to date.
Certificates for /usr/local/etc/openssl/cert.pem: Up to date.
I have done rvm osx-ssl-certs update all again but still the error persists. Also trying to do gem update --system gives the same error.
The output of ruby -ropenssl -e 'p OpenSSL::OPENSSL_VERSION' is "OpenSSL 1.0.2h 3 May 2016"
Any way to fix this ?
Thank You
I had this same problem, the only way it work for me is to download the most updated rubygem from official website, then running the following command:
Download gem from rubygems
Unpack rubygem zip file into any directory
cd into the unpacked rubygem folder
Install with: ruby setup.rb (you may need admin/root privilege)
Enter sudo gem update --system (to test you have most updated rubygem)
...After last step, it responded with Latest version currently installed. Aborting yay! Hope this helps :)

Certificate failure and Windows10 gem version 2.4.5.1

I'm new to much of this:
My problem begins at the rails new sample_app stage of the installrails.com process.
it does its thing, getting to run bundle install and errors with "Could not verify the SSL certificate for https://rubygems.org/."
I search and learn I must update certificates, as discussed here: http://guides.rubygems.org/ssl-certificate-update/
I learn at the above page that rubygems 2.4.x is broken for windows, and therefore no download exists to update my certificates.
So I try to update $ gem update --system 2.6.7 and this is what is returned:
Updating rubygems-update
ERROR: Error installing rubygems-update:
Unable to resolve dependency: user requested 'rubygems-update (= 2.6.7)'
ERROR: While executing gem ... (NoMethodError)
undefined method `version' for nil:NilClass
I keep trying to figure out how to do something so simple as uninstall my gem version 2.4.5.1 and install 2.6.7 but can't do it... my syntax?
I have also seen a workaround using these:
gem sources --remove https://rubygems.org/
gem sources -a http://rubygems.org/
But I don't understand how that helps with certificates or how it is a permanent solution! I removed the secure source, and cannot reobtain it because of the same certificate error. So now I am stuck with the http one. Thanks for your help!
Okay so I started fresh after posting the question.
I used the work around to bypass the certificate problem:
gem sources --remove https://rubygems.org/
gem sources -a http://rubygems.org/
This then allowed me to update my gem version.
gem update --system
Then I switched gem sources back:
gem sources --remove http://rubygems.org/
gem sources -a https://rubygems.org/
I ran into another problem when running rails new sample_app at the same place, bundle install. I found the fix here: Ruby on Rails cannot bundle install
my command was gem install bundler
then I was able to successfully create the sample app. Looking forward to the next problem!

Error: SASS installation for windows

am trying to install sass after installing ruby, but iam getting following error, please help me to fix this
maradhak#WW730VW7X1688 /c/softwares
$ gem -v
2.2.2
maradhak#WW730VW7X1688 /c/softwares
$ 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 retur
ned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (
https://rubygems.org/latest_specs.4.8.gz)
The error has something to do with being vulnerable to the Poodle SSL bug, it will not be verified for that reason. If there's a way to upgrade to a better certificate, but at the time of writing this answer, I could not find the upgraded certificate.
I used the non-SSL host instead, altough I should note that this is not the best nor a permanent solution, it lacks security.
The command used:
gem source -a http://rubygems.org/
A discussion about this subject can be found here: https://github.com/rubygems/rubygems/issues/515#issuecomment-65326585
Update: There seems to be a permanent solution now, which replaces the certificate with a proper protected one. It can be found on the following URL, an tutorial is included in that page.
https://gist.github.com/luislavena/f064211759ee0f806c88#installing-using-update-packages-new
Short answer:
gem sources -a http://rubygems.org/
Confirm than you don't really care about that specific warning, since you trust rubygems.org. Then:
gem install sass
And it works.
thanks for your suggestions, as you guys said this seems to be SSH update issue.
have solved this issue simply down graded my RUBY version from "2.1.5" to "1.8", and the gem version is "1.8.29".
then i was able to install SASS
Following worked for me:
Remove the https source temporary, run gem update --system and then switch back to https.
gem sources --remove https://rubygems.org/
gem sources --add http://rubygems.org
gem update --system
gem sources --remove http://rubygems.org
gem sources --add https://rubygems.org
Ref: https://github.com/rubygems/rubygems/issues/1736
I also encountered the same problem today。
Running gem install sass returned
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=SSLv3read server certificate B: certificate verify failed(https://api.rubygems.org/specs.4.8.gz)
Then I find a way to fix it:
gem sources -a http://rubygems.org/
gem install sass
Adding http://rubygems.org/ to sources solves this.
Here is a capture of my terminal
For me it was a proxy issue. When I appended the proxy details to the gem install command it worked.
gem install sass --http-proxy=http://<yourproxy>:<port>
The first step to Rubygems(http://rubygems.org/) then download sass on(http://rubygems.org/gems/sass)
put in: npm install
You don't need to disable SSH or downgrade your ruby version, you can simply install the SASS gem manually. Here's how to do it:
On windows, first install the Ruby installer for windows.
Download the latest version of the gem from here:
https://rubygems.org/gems/sass Click the latest version, and then on
the right side of the screen (in Links section) click the "Download"
link to download the original gem file (sass-*.*.*.gem)
Now paste the downloaded gem file to the directory that ruby is
installed on: C:\Ruby22-x64\bin\sass-*.*.*.gem
In Command Prompt run the following commands:
cd C:Ruby22-x64/bin
gem install sass-*.*.*.gem1
NOTE: You may also need to call the local flag while installing the gem: gem install --local C:Ruby22-x64/bin/sass-*.*.*.gem
Install a full fledged Cygwin on your windows, the ssh support is good in it. You should be able to install it without any extra efforts, well I always do. In fact once you have Cygwin install you would hardly use the command prompt.
I'm totally new to Ruby and Sass. I didn't want to risk security and I'm on a Windows machine. I had already installed latest ruby, but kept getting the same error message as the OP when trying to run gem install sass at the command prompt.
Here's what solved the problem for me.
Go to: https://rubygems.org/pages/download and follow the instructions on the page starting here (for manual installation):
If you don't have any RubyGems installed, there is still the pre-gem approach to getting software, doing it manually:
Download from above (URL above)
Unpack/unzip into a directory and cd there (into the directory you unzipped it)
Install with: ruby setup.rb (at the command line type that command. You may need admin/root privilege)
After I installed ruby gems, I opened Ruby command prompt (using Start Command Prompt with Ruby from the start menu) and ran the command gem install sass and it worked:
C:\Users\chris>gem install sass
Fetching: sass-3.4.22.gem (100%)
Successfully installed sass-3.4.22
Parsing documentation for sass-3.4.22
Installing ri documentation for sass-3.4.22
Done installing documentation for sass after 36 seconds
1 gem installed
Wanted to detail it as much as possible for other newbies like me. Hope this helps someone.
Changing from http to https makes your computer vulnerable to hackers
I explain some solutions in my answer here: https://stackoverflow.com/a/40075753/845413
If you found this error by searching and are using RVM on OSX just run.
rvm osx-ssl-certs update all
Bundler outlines a few other solutions in their troubleshooting guide for this error: http://bundler.io/v1.16/guides/rubygems_tls_ssl_troubleshooting_guide.html#troubleshooting-certificate-errors
and include...
gem install bundler
gem update --system
Finally, you can simply reinstall RVM or rubygems manually.
Manually install Ruby gems: https://rubygems.org/pages/download
Manually install RVM (recommended): http://rvm.io/

RubyGems - my system can't seem to find any remote gems to install

Trying to install the 'less' gem. I type sudo gem install less as instructed at http://lesscss.org/, and I get the following error:
ERROR: While executing gem ... (Gem::GemNotFoundException)
Could not find less (> 0) in any repository
Alright, so I figure maybe I just need to update RubyGems. Trying 'gem update --system' gets me
Updating RubyGems...
Attempting remote update of rubygems-update
ERROR: While executing gem ... (Gem::InstallError)
rubygems-update requires builder >= 0
Arrgh. Alright, then let's try 'sudo gem install builder':
ERROR: While executing gem ... (Gem::GemNotFoundException)
Could not find builder (> 0) in any repository
Seems that no matter what gem I try to install, it can't be found in any repository. I check my environment, and rubyforge is listed:
RubyGems Environment:
- VERSION: 0.9.4 (0.9.4)
- INSTALLATION DIRECTORY: /usr/local/lib/ruby/gems/1.8
- GEM PATH:
- /usr/local/lib/ruby/gems/1.8
- REMOTE SOURCES:
- http://gems.rubyforge.org
Any idea what's going on? I'm on OSX 10.4, and I installed Ruby 1.8.6 before this.
I think rubygems 1.3.x requires ruby 1.8.7 so you might install that first. Then update rubygems to 1.3.7. via gem update --system
The version of rubygems bundled in osx uses gemforge as its offical source of gems - this has since been replaced with gemcutter. You should be able to do
sudo gem update --system
To upgrade to update the latest version of ruby gems, which will then use gemcutter as the sources link
That's a really old version of rubygems! How did you install this?
Is it a manual install? If so, perhaps you could try a manual upgrade the same way.
Do the following:
sudo gem update --system
to update your install of RubyGems. Then, add the Github gem repository to your sources. I suggest github because you'll find a lot of useful things there:
sudo gem sources -a http://gems.github.com

Can't install gemcutter as a Ruby Gem source

I'm trying to install the thinking sphinx gem, which is on gemcutter.org
When I run the command
gem sources -a http://gemcutter.org
I get the error:
Error fetching http://gemcutter.org:
bad response Not Found 404 (http://gemcutter.org/specs.4.8)
If I change the above URL to http://gemcutter.org.specs.4.8.gz it finds a file. How do I tell rubygems to download with the .gz extension?
It looks like a temporary Gemcutter failure. It works fine to me.
Make sure you are running the latest RubyGems version and install the latest gemcutter gem.
$ gem install gemcutter --source http://gemcutter.org
With the gemcutter GEM you type gem tumble to add Gemcutter as source.
$ gem tumble
EDIT. I just noticed you are using a really outdated RubyGems version.
Update RubyGems first.
$ gem update --system
If it tells you there's nothing to update, you have a buggy version (RubyGems 1.2 selfupdate was buggy). Upgrade with the following command.
$ gem install rubygems-update
$ update_rubygems
Then add the source.
What version of Rubygems are you running (gem --version)? If less than 1.3.5, you may want to update Rubygems and try again. (gem update --system)
This is working for me with the following sources defined:
http://gems.rubyforge.org/
http://gems.github.com
as I said this is working for me:
gem install thinking-sphinx \
> --source http://gemcutter.org
If you're upgrading, you should read this:
http://freelancing-god.github.com/ts/en/upgrading.html
Successfully installed thinking-sphinx-1.3.2
Successfully installed activesupport-2.3.4
2 gems installed
Installing ri documentation for thinking-sphinx-1.3.2...
Installing ri documentation for activesupport-2.3.4...

Resources