在rails应用程序的新ruby中有一些错误

时间:2013-02-12 08:06:48

标签: ruby-on-rails

当我想在rails上创建一个新的ruby应用程序时,我在终端输入“rails new depot”,它有如下错误信息:

"An error occurred while installing multi_json (1.5.1), and Bundler cannot continue.
Make sure that `gem install multi_json -v '1.5.1'` succeeds before bundling."

这是完整的输出:

rails new depot
  create
  create  README.rdoc
  create  Rakefile
  create  config.ru
  create  .gitignore
  create  Gemfile
  create  app
  create  app/assets/images/rails.png
  create  app/assets/javascripts/application.js
  create  app/assets/stylesheets/application.css
  create  app/controllers/application_controller.rb
  create  app/helpers/application_helper.rb
  create  app/views/layouts/application.html.erb
  create  app/mailers/.gitkeep
  create  app/models/.gitkeep
  create  config
  create  config/routes.rb
  create  config/application.rb
  create  config/environment.rb
  create  config/environments
  create  config/environments/development.rb
  create  config/environments/production.rb
  create  config/environments/test.rb
  create  config/initializers
  create  config/initializers/backtrace_silencers.rb
  create  config/initializers/inflections.rb
  create  config/initializers/mime_types.rb
  create  config/initializers/secret_token.rb
  create  config/initializers/session_store.rb
  create  config/initializers/wrap_parameters.rb
  create  config/locales
  create  config/locales/en.yml
  create  config/boot.rb
  create  config/database.yml
  create  db
  create  db/seeds.rb
  create  doc
  create  doc/README_FOR_APP
  create  lib
  create  lib/tasks
  create  lib/tasks/.gitkeep
  create  lib/assets
  create  lib/assets/.gitkeep
  create  log
  create  log/.gitkeep
  create  public
  create  public/404.html
  create  public/422.html
  create  public/500.html
  create  public/favicon.ico
  create  public/index.html
  create  public/robots.txt
  create  script
  create  script/rails
  create  test/fixtures
  create  test/fixtures/.gitkeep
  create  test/functional
  create  test/functional/.gitkeep
  create  test/integration
  create  test/integration/.gitkeep
  create  test/unit
  create  test/unit/.gitkeep
  create  test/performance/browsing_test.rb
  create  test/test_helper.rb
  create  tmp/cache
  create  tmp/cache/assets
  create  vendor/assets/javascripts
  create  vendor/assets/javascripts/.gitkeep
  create  vendor/assets/stylesheets
  create  vendor/assets/stylesheets/.gitkeep
  create  vendor/plugins
  create  vendor/plugins/.gitkeep
     run  bundle install
    Fetching gem metadata from https://rubygems.org/...........
    Fetching gem metadata from https://rubygems.org/..
    Using rake (10.0.3)
    Using i18n (0.6.1)

    Gem::RemoteFetcher::FetchError: SSL_connect returned=1 errno=0 state=SSLv2/v3 read server hello     

    A:  unknown protocol (https://s3.amazonaws.com/production.s3.rubygems.org/gems/multi_json-1.5.1.gem) 
    An error occurred while installing multi_json (1.5.1), and Bundler cannot continue.
    Make sure that `gem install multi_json -v '1.5.1'` succeeds before bundling.

我该如何处理这个问题?

1 个答案:

答案 0 :(得分:0)

[编辑]经过一番研究,我意识到我的问题是没有最新的openssl证书。在较旧的Ruby环境中,它们很好,但在我的RVM 2.0+安装中它们不是。

要更新证书,请按照此处的说明操作:http://railsapps.github.io/openssl-certificate-verify-failed.html

有关更多信息(警告,有很多“我也是”评论要注意),请检查此RubyGems问题:https://github.com/rubygems/rubygems/issues/515