RailsApps / rails3-devise-rspec-cucumber

An example Rails 3.2 app with Devise and RSpec and Cucumber.
http://railsapps.github.io/
444 stars 144 forks source link

SSL Issue using RVM on Ubuntu 11 #13

Closed mrichman closed 13 years ago

mrichman commented 13 years ago

I get the following SSL error when trying to use this template on Ubuntu 11 with RVM 1.8.5 and Ruby 1.9.2.

".../lib/ruby/1.9.1/net/http.rb:678:in `connect': SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (OpenSSL::SSL::SSLError)"
mrichman@ubuntu11:~/code$ rails new test2 -m https://raw.github.com/RailsApps/rails3-application-templates/master/rails3-devise-rspec-cucumber-template.rb -T
      create  
      create  README
      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/mailers
      create  app/models
      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  tmp/cache
      create  tmp/cache/assets
      create  vendor/assets/stylesheets
      create  vendor/assets/stylesheets/.gitkeep
      create  vendor/plugins
      create  vendor/plugins/.gitkeep
       apply  https://raw.github.com/RailsApps/rails3-application-templates/master/rails3-devise-rspec-cucumber-template.rb
/home/mrichman/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/net/http.rb:678:in `connect': SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (OpenSSL::SSL::SSLError)
    from /home/mrichman/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/net/http.rb:678:in `block in connect'
    from /home/mrichman/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/timeout.rb:44:in `timeout'
    from /home/mrichman/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/timeout.rb:89:in `timeout'
    from /home/mrichman/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/net/http.rb:678:in `connect'
    from /home/mrichman/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/net/http.rb:637:in `do_start'
    from /home/mrichman/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/net/http.rb:626:in `start'
    from /home/mrichman/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/open-uri.rb:306:in `open_http'
    from /home/mrichman/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/open-uri.rb:769:in `buffer_open'
    from /home/mrichman/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/open-uri.rb:203:in `block in open_loop'
    from /home/mrichman/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/open-uri.rb:201:in `catch'
    from /home/mrichman/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/open-uri.rb:201:in `open_loop'
    from /home/mrichman/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/open-uri.rb:146:in `open_uri'
    from /home/mrichman/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/open-uri.rb:671:in `open'
    from /home/mrichman/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/open-uri.rb:33:in `open'
    from /home/mrichman/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/actions.rb:212:in `apply'
    from /home/mrichman/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.0/lib/rails/generators/app_base.rb:109:in `apply_rails_template'
    from (eval):1:in `apply_rails_template'
    from /home/mrichman/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/task.rb:22:in `run'
    from /home/mrichman/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/invocation.rb:118:in `invoke_task'
    from /home/mrichman/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/invocation.rb:124:in `block in invoke_all'
    from /home/mrichman/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/invocation.rb:124:in `each'
    from /home/mrichman/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/invocation.rb:124:in `map'
    from /home/mrichman/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/invocation.rb:124:in `invoke_all'
    from /home/mrichman/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/group.rb:226:in `dispatch'
    from /home/mrichman/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/base.rb:389:in `start'
    from /home/mrichman/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.0/lib/rails/commands/application.rb:31:in `<top (required)>'
    from /home/mrichman/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /home/mrichman/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /home/mrichman/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.0/lib/rails/cli.rb:15:in `<top (required)>'
    from /home/mrichman/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /home/mrichman/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /home/mrichman/.rvm/gems/ruby-1.9.2-p290/gems/rails-3.1.0/bin/rails:7:in `<top (required)>'
    from /home/mrichman/.rvm/gems/ruby-1.9.2-p290/bin/rails:19:in `load'
    from /home/mrichman/.rvm/gems/ruby-1.9.2-p290/bin/rails:19:in `<main>'

Here is my RVM info:

mrichman@ubuntu11:~/code$ rvm info

ruby-1.9.2-p290:

  system:
    uname:       "Linux ubuntu11 2.6.38-11-generic #50-Ubuntu SMP Mon Sep 12 21:18:14 UTC 2011 i686 i686 i386 GNU/Linux"
    bash:        "/bin/bash => GNU bash, version 4.2.8(1)-release (i686-pc-linux-gnu)"
    zsh:         " => not installed"

  rvm:
    version:      "rvm 1.8.5 by Wayne E. Seguin (wayneeseguin@gmail.com) [https://rvm.beginrescueend.com/]"

  ruby:
    interpreter:  "ruby"
    version:      "1.9.2p290"
    date:         "2011-07-09"
    platform:     "i686-linux"
    patchlevel:   "2011-07-09 revision 32553"
    full_version: "ruby 1.9.2p290 (2011-07-09 revision 32553) [i686-linux]"

  homes:
    gem:          "/home/mrichman/.rvm/gems/ruby-1.9.2-p290"
    ruby:         "/home/mrichman/.rvm/rubies/ruby-1.9.2-p290"

  binaries:
    ruby:         "/home/mrichman/.rvm/rubies/ruby-1.9.2-p290/bin/ruby"
    irb:          "/home/mrichman/.rvm/rubies/ruby-1.9.2-p290/bin/irb"
    gem:          "/home/mrichman/.rvm/rubies/ruby-1.9.2-p290/bin/gem"
    rake:         "/home/mrichman/.rvm/gems/ruby-1.9.2-p290/bin/rake"

  environment:
    PATH:         "/home/mrichman/.rvm/gems/ruby-1.9.2-p290/bin:/home/mrichman/.rvm/gems/ruby-1.9.2-p290@global/bin:/home/mrichman/.rvm/rubies/ruby-1.9.2-p290/bin:/home/mrichman/.rvm/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"
    GEM_HOME:     "/home/mrichman/.rvm/gems/ruby-1.9.2-p290"
    GEM_PATH:     "/home/mrichman/.rvm/gems/ruby-1.9.2-p290:/home/mrichman/.rvm/gems/ruby-1.9.2-p290@global"
    MY_RUBY_HOME: "/home/mrichman/.rvm/rubies/ruby-1.9.2-p290"
    IRBRC:        "/home/mrichman/.rvm/rubies/ruby-1.9.2-p290/.irbrc"
    RUBYOPT:      ""
    gemset:       ""
DanielKehoe commented 13 years ago

I suspect this error is not specific to the rails3-devise-rspec-cucumber application template. You can verify this by trying another app template:

rails new myapp -m https://github.com/rubyx/rails3_template/raw/master/init.rb

Does it fail in the same way?

If so, I suggest asking for help on Stack Overflow: http://stackoverflow.com/questions/tagged/jruby

I suspect there is a problem with openssl in your environment.

As a workaround, you can download the template directly and run it from your filesystem.

If you get more information, please post here again or email me so I provide information to other users who may run into the same problem.

-- Daniel

mrichman commented 13 years ago

I found the solution for Ubuntu:

Download http://curl.haxx.se/ca/cacert.pem and save it in /etc/ssl/certs, then run sudo update-ca-certificates. I guess DigiCert (GitHub's CA) is not supported out of the box with Ubuntu.

The templates all work fine now.

Thanks!

kagemusha commented 12 years ago

I ran into same problem on OSX. Put up a gist here:

https://gist.github.com/1391549