having problems with railsinstaller

2019-04-01 10:49发布

问题:

I've been having problems with railsinstaller on my windows 8 laptop which originates from the inability to run the server in the (project) directory using the rails s command however contrary to the many tutorials out there, I receive this every time.

C:\Sites\demo>rails s
Could not find gem 'tzinfo-data (>= 0) x86-mingw32' in the gems available on thi
s machine.
Run `bundle install` to install missing gems.

Then when I try and run bundle install it returns this error.

C:\Sites\demo>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.

C:\Sites\demo>

But everything I have tried to resolve the "FetchError" has been useless.

Could someone please help me with this error?

回答1:

Seems to be Windows-specific. I had this issue as well and resolved it by upgrading to newest RubyGems.

  1. You can download the installer (zip) on RubyGems website
  2. Unpack it somewhere you can easily access (let's assume C:\Ruby\RubyGems)
  3. Bring up your command line (Win+R, cmd, Enter)
  4. Get to the directory you unpacked the installer to:
    cd C:\Ruby\RubyGems
  5. Run ruby setup.rb


回答2:

If you are doing this for your own, In the Gemfile replace the url https://rubygems.org/ as http://rubygems.org.



回答3:

The problem is comes from the https:// as @Saravanan said. You can fixed this issue using the following command on your ruby on rails command line tool.

gem sources -a http://rubygems.org/

If you update this source to http:// URL. you would be solve this issue.