【问题标题】:Error with installing rspec-rails and capybara gems安装 rspec-rails 和 capybara gems 时出错
【发布时间】:2012-05-12 12:50:36
【问题描述】:

简要背景:

我的 Gemfile 看起来像这样:

source 'https://rubygems.org'

gem 'rails', '3.2.3'

# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'

group :development do
    gem 'sqlite3', '1.3.5'
    gem 'rspec-rails', '2.9.0'
end

gem 'therubyracer'

# group :production do
#   gem 'pg', '0.12.2'
# end

# Gems used only for assets and not required
# in production environments by default.
group :assets do
  gem 'sass-rails',   '3.2.4'
  gem 'coffee-rails', '3.2.2'

  # See https://github.com/sstephenson/execjs#readme for more supported runtimes
  # gem 'therubyracer', :platform => :ruby

  gem 'uglifier', '1.2.3'
end

group :test do
    # gem 'capybara', '1.1.2'
end

gem 'jquery-rails', '2.0.0'

# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'

# To use Jbuilder templates for JSON
# gem 'jbuilder'

# Use unicorn as the app server
# gem 'unicorn'

# Deploy with Capistrano
# gem 'capistrano'

# To use debugger
# gem 'ruby-debug19', :require => 'ruby-debug'

在我的应用程序文件夹中运行捆绑安装时,我收到以下错误:

$ bundle install
Fetching gem metadata from https://rubygems.org/........
Using rake (0.9.2.2) 
Using i18n (0.6.0) 
Using multi_json (1.3.5) 
Using activesupport (3.2.3) 
Using builder (3.0.0) 
Using activemodel (3.2.3) 
Using erubis (2.7.0) 
Using journey (1.0.3) 
Using rack (1.4.1) 
Using rack-cache (1.2) 
Using rack-test (0.6.1) 
Using hike (1.2.1) 
Using tilt (1.3.3) 
Using sprockets (2.1.3) 
Using actionpack (3.2.3) 
Using mime-types (1.18) 
Using polyglot (0.3.3) 
Using treetop (1.4.10) 
Using mail (2.4.4) 
Using actionmailer (3.2.3) 
Using arel (3.0.2) 
Using tzinfo (0.3.33) 
Using activerecord (3.2.3) 
Using activeresource (3.2.3) 
Using bundler (1.1.3) 
Using coffee-script-source (1.3.1) 
Using execjs (1.3.2) 
Using coffee-script (2.2.0) 
Using rack-ssl (1.3.2) 
Using json (1.7.3) 
Using rdoc (3.12) 
Using thor (0.14.6) 
Using railties (3.2.3) 
Using coffee-rails (3.2.2) 

Gem::RemoteFetcher::FetchError: SSL_connect SYSCALL returned=5 errno=0 state=SSLv3 read server certificate A (https://rubygems.cachefly.net/gems/diff-lcs-1.1.3.gem)
An error occured while installing diff-lcs (1.1.3), and Bundler cannot continue.
Make sure that `gem install diff-lcs -v '1.1.3'` succeeds before bundling.

但是,如果我注释掉 gem rspec-rails', '2.9.0',它的安装很顺利。我认为问题在于 gem 的安装方式。请帮忙看看怎么办?如果您需要更多信息,请告诉我。

【问题讨论】:

  • 可能和这里stackoverflow.com/questions/9410814/…的问题一样吗?
  • 本来可以,但事实并非如此。不管怎么说,还是要谢谢你。问题解决了。请参阅下面的评论。

标签: ruby-on-rails rspec bundler


【解决方案1】:

您可以尝试在再次捆绑之前安装 diff-lcs

gem install diff-lcs -v '1.1.3
bundle install

【讨论】:

  • 大家好,我想这最终归结为网络问题。我使用相同的 Gemfile 运行相同的命令并且它有效。对于所有可能面临此类错误的朋友。我会说在 7-8 小时后尝试。我应该工作。虽然,我不确定为什么会这样。谁能猜到?
【解决方案2】:

由于 SSL 特定错误的性质,您可能需要考虑切换到非安全连接来获取 gem。正如this other answer 中所建议的那样,检查您的Gemfile 是否有类似的行:

source 'https://rubygem.org'

并将其更改为非https版本:

source 'http://rubygem.org'

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-01-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-05-09
    • 2017-11-29
    相关资源
    最近更新 更多