Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting up Rails server

I'm a beginner in Ruby, following "Creating a New Rails Project".

But I can't start the server. I tried:

  1. running rails server but got:

    Could not find gem 'tzinfo-data <>= 0> x86-mingw32' in the gems available on the machine. 
    Run 'bundle install' to install missing gems.
    
  2. running bundle install but got:

    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.
    
  3. gem 'tzinfo-data' but got:

    Unknown command tzinfo-data
    
  4. gem install tzinfo-data:

    Could not find a valid gem 'tzinfo-data' <>= 0>, here is why:
    Unable to download data from...
    

I have Windows 8.1. 64-bit


tzinfo-data was resolved with a cacert.pem file following the guide in the accepted answer. Today I am trying to install bootstrap-sass gem file. Do I need an another .pem file?

Gem::RemoteFetcher::FetchError: SSL_connect returned=1 errno=0 state=SSLv3 read
server certificate B: certificate verify failed (https://rubygems.org/gems/boots
trap-sass-3.3.1.0.gem)
An error occurred while installing bootstrap-sass (3.3.1.0), and Bundler cannot
continue.
Make sure that `gem install bootstrap-sass -v '3.3.1.0'` succeeds before
bundling.
like image 912
Roland Jegorov Avatar asked Oct 20 '22 20:10

Roland Jegorov


1 Answers

You have a common SSL issue.

You will see this error message:

certificate verify failed

The error message is because your system needs a new SSL certificate.

Here's information about it:

http://railsapps.github.io/openssl-certificate-verify-failed.html

On Windows:

Try upgrading your SSL certificates.

  1. Download http://curl.haxx.se/ca/cacert.pem.

  2. Save this file anywhere you want, such as:

    C:\RailsInstaller\cacert.pem
    
  3. On the command line, tell Ruby where to find the cert file, such as:

    set SSL_CERT_FILE=C:\RailsInstaller\cacert.pem
    
  4. Retry the gem installation.

  5. If it works, that's great. If you want this to work with every project on your system, and also survive rebooting, then you can make the cert file permanent by adding the cert system-wide. To do this, use your Windows control panel.

Credit and more info: https://gist.github.com/fnichol/867550

like image 187
joelparkerhenderson Avatar answered Oct 22 '22 10:10

joelparkerhenderson