简体   繁体   中英

Make sure that 'gem install ~ ' succeeds before bundling

I began learning Ruby on rails today. I have installed Ruby, DEVELOPMENT KIT, SQLite3, bundler and rails.

Next, My textbook says to run rails new todo in the console. Then, the following message appeared:

Gem::RemoteFetcher::FetchError: SSL_connect returned=1 errno=0 state=SSLv3 read
server certificate B: certificate verify failed (https://rubygems.org/gems/coffee-rails-4.0.1.gem)
An error occurred while installing execjs (2.2.2), and Bundler cannot
continue.
Make sure that `gem install execjs -v '2.2.2'` succeeds before bundling.

I did as follows.

C:\rubyfolder>gem install execjs -v 2.2.2

Then it appeared as follows:

Fetching: execjs-2.2.2.gem (100%)
Successfully installed execjs-2.2.2
Parsing documentation for execjs-2.2.2
Installing ri documentation for execjs-2.2.2
Done installing documentation for execjs after 1 seconds
WARNING:  Unable to pull data from 'https://rubygems.org/': SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (https://api.rubygems.org/specs.4.8.gz)
1 gem installed

Next, I ran rails new todo again. Then, the message that execjs of above message is replaced by coffee-script appeared.

Make sure that `gem install coffee-script -v '2.3.0'` succeeds before bundling.

Next, I installed coffee-script.

I have repeated this kind of work for 3 or 4 times, but it don't finish. What should I do?

( execjs might not be the first of this cycle. I can't see first part of logs)

I have faced similar kind of issue. This is what worked for me:

  1. In your Gemfile or wherever you have specified the gems list and replace source 'https://......' with this source 'http://.......' otherwise it will keep on asking Make sure that gem install gem_name__ v xxx' succeeds before bundling.`
  2. Do bundle install or rails new todo
  3. Done, no error this time.

Just to run gem install separatly doesn't solve the root of the problem. Looks like you didn't install all needed development dependencies for Rails. Try to complete libraries within official instruction .

Also I see from you path you try it on Windows and probably you need to install dependencies this way, cause official documentation doesn't provide instructions for this OS: gem install rails --include-dependencies

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM