在捆绑之前确保'gem install~'成功

use*_*216 4 ruby ruby-on-rails

我今天开始学习Ruby on rails.我已经安装了Ruby,DEVELOPMENT KIT,SQLite3,bundler和rails.

接下来,我的教科书说要rails new todo在控制台中运行.然后,出现以下消息:

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.
Run Code Online (Sandbox Code Playgroud)

我做了如下.

C:\rubyfolder>gem install execjs -v 2.2.2
Run Code Online (Sandbox Code Playgroud)

然后它出现如下:

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
Run Code Online (Sandbox Code Playgroud)

接下来,我又跑rails new todo了.然后,execjs上面的消息的消息被coffee-script出现替换.

Make sure that `gem install coffee-script -v '2.3.0'` succeeds before bundling.
Run Code Online (Sandbox Code Playgroud)

接下来,我安装了咖啡脚本.

我已经重复了这种工作3到4次,但它没有完成.我该怎么办?

(execjs可能不是这个周期的第一个.我看不到日志的第一部分)

pau*_*aul 7

我遇到过类似的问题.这对我有用:

  1. 在您Gemfile或您指定了gems列表的任何地方,并替换source 'https://......'为此,source 'http://.......'否则它将Make sure that gem install gem_name__ v xxx'在捆绑之前继续询问成功
  2. bundle installrails new todo
  3. 完成,这次没有错误.


Ten*_*sho 0

仅仅单独运行并gem install不能解决问题的根源。看起来您没有安装 Rails 所需的所有开发依赖项。尝试在官方指导下完成图书馆

另外我从你的路径中看到你在 Windows 上尝试它,可能你需要以这种方式安装依赖项,因为官方文档没有提供此操作系统的说明: gem install rails --include-dependencies