Unable to install gems - ruby-on-rails

I am unable to install gems, what changes do I need to do in my settings of browser to get downloaded? I am using Windows 7
C:\Users\MAX JOHN>gem install rails --no-ri --no-rdoc
ERROR: Could not find a valid gem 'rails' (>= 0), here is why:
Unable to download data from https://rubygems.org/ - SSL_connect retur
ned=1 errno=0 state=SSLv2/v3 read server hello A: unknown protocol (https://ruby
gems.org/latest_specs.4.8.gz)
C:\Users\MAX JOHN>gem install mysql
ERROR: Could not find a valid gem 'mysql' (>= 0), here is why:
Unable to download data from https://rubygems.org/ - SSL_connect retur
ned=1 errno=0 state=SSLv2/v3 read server hello A: unknown protocol (https://ruby
gems.org/latest_specs.4.8.gz)

setting the source to http instead of https is not recommended as it creates security issues.
Try pinging https://rubygems.org, this will tell you if the problem is with your connection issues or not.
Assuming you're using Rails 3, have a look at this post on how to set up WEBrick to use SSL:
http://www.nearinfinity.com/blogs/chris_rohr/configuring_webrick_to_use_ssl.html

Do you have more than one version of Ruby installed? I accidentally upgraded without removing a prior installation, and removing that fixed the same issue for me.

I had similar problem, and solved it by:
Downloading the gem via web browser from https://rubygems.org/
Install it locally by cd ing into the dir where the gem was downloaded and ran:
gem install --local .gem

Related

Couldn't install rails in windows 8.1

I had install ruby -version 2.2.4p230 but unable to install rails by using gem install rails. After writing this line in CMD the error saying Could not find a valid gem 'rails' (>= 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/latest_specs.4.8.gz)
I had searched a lot about this but didn't get anything useful for me. Please do a help for installing the rails.
Exact same error. Another poster suggested this link. http://guides.rubygems.org/ssl-certificate-update/ but it didn't work for me.
ruby -v
ruby 2.2.5p319
gem --version
2.4.5.1
gem install rails
Error: could not find a valid gem 'rails' <>=0>, here is why: Unable to download data from links removed not enough rep to post* This page suggests a manual certificate fix which I will try next http://guides.rubygems.org/ssl-certificate-update/#background I am thinking the pem file is not located correctly.

Failed to Install gem Install rails ERROR Could not find a valid gem 'rails'

gem install rails -v 3.2.14
ERROR: Could not find a valid gem 'rails' (=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://s3.amazonaws.com/production.s3.rubygems.org/specs.4.8.gz)
Maybe you want to try install ruby with rbenv very easy to use and update:http://octopress.org/docs/setup/rbenv/
I believe your machine is running on secure VPN. In my case I experienced same error whenever I try to install any gem while I am connected to secure VPN. Try to disconnect from VPN and try to install the rails gem again.
Hope it helps!!

Ruby on rails windows installed using railsInstaller fails to install gems / bundles

I have an existing project which is stored on bitbucket, and just cloned that onto my windows box.
I enter the main project directory and run
rails server
I get the message:
Could not find rake-10.4.1 in any of the sources
Run `bundle install` to install missing gems.
so I run bundle install - which responds:
DL is deprecated, please use Fiddle
Fetching gem metadata from https://rubygems.org/............
Resolving dependencies...
Gem::RemoteFetcher::FetchError: SSL_connect returned=1 errno=0 state=SSLv3 read
server certificate B: certificate verify failed (https://rubygems.org/gems/rake-
10.4.1.gem)
An error occurred while installing rake (10.4.1), and Bundler cannot continue.
Make sure that `gem install rake -v '10.4.1'` succeeds before bundling.
So I run command
gem install rake -v '10.4.1'
Which responds:
ERROR: Could not find a valid gem 'rake' (= 10.4.1), 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://api.rubygems.org/specs.4.8.gz)
I read some other posts and people were asked to run this command:
ruby -ropenssl -e 'p OpenSSL::OPENSSL_VERSION'
Which responds:
"OpenSSL 1.0.0o 15 Oct 2014"
Please can somebody guide me as to what is wrong here!
This seems to be some longstanding issue with Ruby on windows.
I solved it by following these windows fix instructions:
https://gist.github.com/fnichol/867550

installing rails unable to download data

I'm trying to install rails on a new computer and am running to the following command issue:
gem install rails
ERROR: Could not find a valid gem 'rails' (>= 0), here is why:
Unable to download data from http://gems.rubyforge.org/ -SSL_connect reuterned=1 error=0 state=SSLv2/v3 read server hello A: Unknown protocol (http://gems.rubyforge.org/latest_specs.4.8.gz)
Make sure you are using the latest rvm than you can update your certificates and rubygems. Or just use the non-ssl source.

Why can't I install any gems on my Mac?

I tried doing gem install for just about any gem and I have been getting errors. I think I need to reset and or update something on my computer but not sure what.
Here is some of the command line code errors:
ERROR: Could not find a valid gem 'multi_json' (>= 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://s3.amazonaws.com/production.s3.rubygems.org/latest_specs.4.8.gz)
ERROR: Could not find a valid gem 'cowsay' (>= 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://s3.amazonaws.com/production.s3.rubygems.org/latest_specs.4.8.gz)
sudo gem install rubygems-update
Password:
ERROR: Could not find a valid gem 'rubygems-update' (>= 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://s3.amazonaws.com/production.s3.rubygems.org/latest_specs.4.8.gz)
Does anyone know what I need to do to fix this? I got a new computer and was wondering if I need to set up the user differently or something?
I had the same problem and this solution from above user worked for me.
rvm osx-ssl-certs update all
There seems to be this common issue lately. If you're on a Mac, try doing this if you installed via RVM:
rvm osx-ssl-certs update all
Alternatively you can add the insecure ruby source with the following command:
sudo gem sources -a http://rubygems.org
For those that arent using rvm, but are using homebrew:
brew tap raggi/ale
brew install openssl-osx-ca
This worked for me.

Resources