Update bash error for ruby on rails - ruby-on-rails

When I try to start a new project - my command I'm using is:
rails new testproject
But when it tries to install the bundle I end up with the error message:
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.2.gem>
An error occured while installing rake <10.4.2>, and Bundler cannot continue. Make sure that 'gem install rake -v '10.4.2' ' succeeds before bundling.
So then I try to install that rake version, using
gem install rake -v 10.4.2
and I get the same SSL read server certificate error.
Now I've tried to figure out how to fix this. From what I can tell, I need to update my Bash version, but that's impossible for me - it just tells me what bash version I have when I give it the command
\curl -sSL https://get.rvm.io | bash -s stable --ruby
found on https://rvm.io/rvm/install.
How do I fix this issue and how do I get an actual working version of RoR on my computer without having to do everything manually? Almost all the other places I've been to eventually point back to railsinstaller.org, and that does me no good.
Thank you very much for your help!

There seems to be something wrong with the certificates. You could try to fetch the packages from hhtp instead using something like:
sudo gem sources -r https://rubygems.org
sudo gem sources -a http://rubygems.org
Ref this

Related

"Certificate verify failed" while using http://rubygems.org instead of https

I used to get a certificate verification error when I used the https:/rubygems.org.
A workaround was suggested: remove the "s" (so I end up using http instead of https). It worked for some time but today after starting a new rails application rails new 'filename' I got the same certificate validation error:
Gem::RemoteFetcher::FetchError: SSL_connect returned=1 errno=0 state=SSLv3 read
server certificate B: certificate verify failed
(https://rubygems.org/gems/mime-types-data-3.2016.0521.gem)
An error occurred while installing mime-types-data (3.2016.0521), and Bundler
cannot continue.
Make sure that gem install mime-types-data -v '3.2016.0521' succeeds before
bundling.
I typed gem sources only to find that https://rubygems.org doesn't even exist.
$ gem sources
*** CURRENT SOURCES ***
http://rubygems.org
I go to the gemfile and I find
source 'https://rubygems.org'
What could be the problem?
Be sure to update the certificate, http://guides.rubygems.org/ssl-certificate-update/
Then look for default cert file
ruby -ropenssl -e 'p OpenSSL::X509::DEFAULT_CERT_FILE' that outputs "/usr/local/etc/openssl/cert.pem"
And then renamed, that will use the new certificate you downloaded
mv /usr/local/etc/openssl/cert.pem /usr/local/etc/openssl/cert.pem.old
If anyone is still seeing this issue on Ubuntu 20.04 with ARMV7, ensure:
ca-certificates is installed
run update-ca-certificates at least once after updating OS packages
You may additionally need to install the GlobalSign certificate prior to running update-ca-certificates:
curl -sL -o /usr/local/share/ca-certificates/GlobalSignRootCA_R3.crt https://raw.githubusercontent.com/rubygems/rubygems/master/lib/rubygems/ssl_certs/rubygems.org/GlobalSignRootCA_R3.pem
This appeared to fix the issue for me.

Creating a Rails app in Windows

I have been trying to install Rails on my Windows PC for the past days. I got the bundle from www.railsinstaller.org and it installed great. When creating a new application I can see that all the app files are created then I get the following error:
bundle install
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.2.gem) An error occurred while
installing rake (10.4.2), and Bundler cannot continue. Make sure that
gem install rake -v '10.4.2' succeeds before bundling.
Hoping someone can help with resolving this.
This link could be helpful.
Creating a Ruby on Rails environment on Windows, in a VM Vagrant Box
Instead of install ROR directly onto Windows, you might want to use a Linux like OS. Not because Rails environment cannot be setup in Windows. But all the problems you will encounter, especially when most of tools are designed for that when you are not using a Linux like OS and try to mimic that.
But I highly recommend you skip doing all that if you are just trying to learn, and use Nitrous.io, which is an online IDE that gives you all the tool.
IMHO, dealing with Windows in this case is a waste of time.
First message:
DL is deprecated, please use Fiddle Fetching gem metadata ..
is a warning message. You read about it here.
The main error is encountered while installing rake.
An error occurred while installing rake (10.4.2), and Bundler cannot
continue. Make sure that gem install rake -v '10.4.2' succeeds before
bundling.
To solve this, you should first update Rubygems:
gem update --system
And then update Bundler:
gem install bundler
I simply run
gem update --system
and it fixed. More info please check bundle install fails with SSL certificate verification error

Error with installing Rails 4

I have problem with installing Rails 4. Hope you could help!
demo
$ rails -v
Rails is not currently installed on this system. To get the latest version, simply type:
$ sudo gem install rails
You can then rerun your "rails" command.
demo
$ sudo gem install rails
WARNING: Improper use of the sudo command could lead to data loss
or the deletion of important system files. Please double-check your
typing when using sudo. Type "man sudo" for more information.
To proceed, enter your password, or type Ctrl-C to abort.
Password:
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/latest_specs.4.8.gz)
The Best Solution for installing Rails is by Using Ruby Version Manager(RVM)
run curl -L https://get.rvm.io | bash -s stable to install RVM and the Install Ruby Using RVM by this Command rvm install 2.0.0 then Install Rails from this command
gem install rails -v 4.0.0
You can good to go then.
Had the same issue and everything is described here: http://railsapps.github.io/openssl-certificate-verify-failed.html
tl;dr Recent versions of RVM, the Ruby Version Manager, include a utility to diagnose and resolve errors caused by outdated certificate files. See the article Installing Rails for instructions and advice. The RVM website explains how to install RVM.
If you’ve installed RVM, try this:
$ rvm -v
# rvm 1.19.1 (stable)
$ rvm osx-ssl-certs status all
# Certificates for...
$ rvm osx-ssl-certs update all
# Updating certificates...
That’s all that is needed to resolve the issue if you are using RVM (you must be using RVM version 1.19.1 or newer).

Why do I get OpenSSL::SSL::SSLError when installing Rails?

When I run 'sudo gem install rails', this error occurs:
ERROR: While executing gem ... (OpenSSL::SSL::SSLError)
SSL_connect SYSCALL returned=5 errno=0 state=SSLv3 read server session ticket A
BTW, I'm running Ruby version 1.9.3p0, Gem version 2.0.3, and OpenSSL version OpenSSL 1.0.1.
Any advice?
Please try the following commands
Root causes
1) outdate open SSL
$ rvm -v
$ rvm get head
2) outdate bundle
$ gem install bundle
hope it will solve
try this :
$ gem update --system
While I was about installing rails, I also get the exact same error. As Aye Mon Chit mention earlier, this error is possibly caused by an outdated open SSL. Here's my solution: update your openssl
In my Wheezy, I simply run:
apt-get install openssl
And that's all. Hope this help somebody out there.

"bundle install" causes Gem::RemoteFetcher::FetchError on each gem

When calling
rails new project
The process progresses until I hit bundle install. At that point:
identical vendor/plugins/.gitkeep
run bundle install
Fetching gem metadata from https://rubygems.org/.........
Gem::RemoteFetcher::FetchError: SSL_connect returned=1 errno=0 state=unknown state: sslv3 alert handshake failure (https://d2chzxaqi4y7f8.cloudfront.net/gems/rake-0.9.2.2.gem)
An error occured while installing rake (0.9.2.2), and Bundler cannot continue.
Make sure that `gem install rake -v '0.9.2.2'` succeeds before bundling.
I can install the gem manually with gem install and launch rails new again, and the error repeats for the next gem. I end up installing manually every single gem.
I use rvm 1.13.0 single user.
Do you have OpenSSL installed? You don't mention your OS, but on Ubunutu (or other Debian-based distros) you do:
sudo apt-get install openssl
Failing that, try http://railsapps.github.com/openssl-certificate-verify-failed.html
Try this.
rvm pkg install openssl
rvm reinstall 1.9.2 --with-openssl-dir=$rvm_path/usr

Resources