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

Issue generating new app using jruby #10

Closed just3ws closed 13 years ago

just3ws commented 13 years ago

I tried to generate the rails app using jruby-1.6.4, but ran into a certificate issue. I needed to install jruby-openssl, but that's not a big deal.

The problem appears to be there was a bad ssl certificate somewhere.

The offending error occurs within....

apply_rails_template at /Users/mdh/.rvm/gems/jruby-1.6.4@APP_NAME/gems/railties-3.1.0/lib/rails/generators/app_base.rb:109

I've inlined the entire stack trace....

   apply  https://github.com/RailsApps/rails3-application-templates/raw/master/rails3-devise-rspec-cucumber-template.rb

OpenSSL::SSL::SSLError: certificate verify failed connect at org/jruby/ext/openssl/SSLSocket.java:179 connect at /Users/mdh/.rvm/rubies/jruby-1.6.4/lib/ruby/1.8/net/http.rb:586 do_start at /Users/mdh/.rvm/rubies/jruby-1.6.4/lib/ruby/1.8/net/http.rb:553 start at /Users/mdh/.rvm/rubies/jruby-1.6.4/lib/ruby/1.8/net/http.rb:542 open_http at /Users/mdh/.rvm/rubies/jruby-1.6.4/lib/ruby/1.8/open-uri.rb:242 buffer_open at /Users/mdh/.rvm/rubies/jruby-1.6.4/lib/ruby/1.8/open-uri.rb:616 open_loop at /Users/mdh/.rvm/rubies/jruby-1.6.4/lib/ruby/1.8/open-uri.rb:164 catch at org/jruby/RubyKernel.java:1191 open_loop at /Users/mdh/.rvm/rubies/jruby-1.6.4/lib/ruby/1.8/open-uri.rb:162 open_uri at /Users/mdh/.rvm/rubies/jruby-1.6.4/lib/ruby/1.8/open-uri.rb:132 open at /Users/mdh/.rvm/rubies/jruby-1.6.4/lib/ruby/1.8/open-uri.rb:518 open at /Users/mdh/.rvm/rubies/jruby-1.6.4/lib/ruby/1.8/open-uri.rb:30 apply at /Users/mdh/.rvm/gems/jruby-1.6.4@APP_NAME/gems/thor-0.14.6/lib/thor/actions.rb:212 apply_rails_template at /Users/mdh/.rvm/gems/jruby-1.6.4@APP_NAME/gems/railties-3.1.0/lib/rails/generators/app_base.rb:109 apply_rails_template at (eval):1 send at org/jruby/RubyKernel.java:2092 run at /Users/mdh/.rvm/gems/jruby-1.6.4@APP_NAME/gems/thor-0.14.6/lib/thor/task.rb:21 invoke_task at /Users/mdh/.rvm/gems/jruby-1.6.4@APP_NAME/gems/thor-0.14.6/lib/thor/invocation.rb:118 invoke_all at /Users/mdh/.rvm/gems/jruby-1.6.4@APP_NAME/gems/thor-0.14.6/lib/thor/invocation.rb:124 each at /Users/mdh/.rvm/gems/jruby-1.6.4@APP_NAME/gems/thor-0.14.6/lib/thor/core_ext/ordered_hash.rb:75 collect at org/jruby/RubyEnumerable.java:706 invoke_all at /Users/mdh/.rvm/gems/jruby-1.6.4@APP_NAME/gems/thor-0.14.6/lib/thor/invocation.rb:124 dispatch at /Users/mdh/.rvm/gems/jruby-1.6.4@APP_NAME/gems/thor-0.14.6/lib/thor/group.rb:226 start at /Users/mdh/.rvm/gems/jruby-1.6.4@APP_NAME/gems/thor-0.14.6/lib/thor/base.rb:389 (root) at /Users/mdh/.rvm/gems/jruby-1.6.4@APP_NAME/gems/railties-3.1.0/lib/rails/commands/application.rb:31 require at org/jruby/RubyKernel.java:1038 require at /Users/mdh/.rvm/gems/jruby-1.6.4@APP_NAME/gems/railties-3.1.0/lib/rails/commands/application.rb:29 (root) at /Users/mdh/.rvm/gems/jruby-1.6.4@APP_NAME/gems/railties-3.1.0/lib/rails/cli.rb:15 require at org/jruby/RubyKernel.java:1038 require at /Users/mdh/.rvm/gems/jruby-1.6.4@APP_NAME/gems/railties-3.1.0/lib/rails/cli.rb:29 (root) at /Users/mdh/.rvm/gems/jruby-1.6.4@APP_NAME/gems/rails-3.1.0/bin/rails:7 load at org/jruby/RubyKernel.java:1063 (root) at /Users/mdh/.rvm/gems/jruby-1.6.4@APP_NAME/bin/rails:19

Here are the full set of steps to reproduce the issue.....

09:49:36 mdh@just3ws-groupon:~/src/scratch jruby-1.6.4@APP_NAME ☱ gem list -a

09:49:39 mdh@just3ws-groupon:~/src/scratch jruby-1.6.4@APP_NAME ☱ gem install rails bundler Depending on your version of ruby, you may need to install ruby rdoc/ri data:

<= 1.8.6 : unsupported = 1.8.7 : gem install rdoc-data; rdoc-data --install = 1.9.1 : gem install rdoc-data; rdoc-data --install

= 1.9.2 : nothing to do! Yay! Successfully installed multi_json-1.0.3 Successfully installed activesupport-3.1.0 Successfully installed builder-3.0.0 Successfully installed i18n-0.6.0 Successfully installed bcrypt-ruby-3.0.1-java Successfully installed activemodel-3.1.0 Successfully installed rack-1.3.3 Successfully installed rack-cache-1.0.3 Successfully installed rack-test-0.6.1 Successfully installed rack-mount-0.8.3 Successfully installed hike-1.2.1 Successfully installed tilt-1.3.3 Successfully installed sprockets-2.0.0 Successfully installed erubis-2.7.0 Successfully installed actionpack-3.1.0 Successfully installed arel-2.2.1 Successfully installed tzinfo-0.3.29 Successfully installed activerecord-3.1.0 Successfully installed activeresource-3.1.0 Successfully installed mime-types-1.16 Successfully installed polyglot-0.3.2 Successfully installed treetop-1.4.10 Successfully installed mail-2.3.0 Successfully installed actionmailer-3.1.0 Successfully installed rake-0.9.2 Successfully installed thor-0.14.6 Successfully installed rack-ssl-1.3.2 Successfully installed rdoc-3.9.4 Successfully installed railties-3.1.0 Successfully installed bundler-1.0.18 Successfully installed rails-3.1.0 Successfully installed bundler-1.0.18 32 gems installed 09:49:55 mdh@just3ws-groupon:~/src/scratch jruby-1.6.4@APP_NAME ☱ 09:49:55 mdh@just3ws-groupon:~/src/scratch jruby-1.6.4@APP_NAME ☱ rails new APP_NAME -m https://github.com/RailsApps/rails3-application-templates/raw/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://github.com/RailsApps/rails3-application-templates/raw/master/rails3-devise-rspec-cucumber-template.rb

JRuby limited openssl loaded. http://jruby.org/openssl gem install jruby-openssl for full support. The template [https://github.com/RailsApps/rails3-application-templates/raw/master/rails3-devise-rspec-cucumber-template.rb] could not be loaded. Error: OpenSSL::SSL requires the jruby-openssl gem 09:49:59 mdh@just3ws-groupon:~/src/scratch jruby-1.6.4@APP_NAME ☱ gem install jruby-openssl Successfully installed bouncy-castle-java-1.5.0146.1 Successfully installed jruby-openssl-0.7.4 2 gems installed 09:50:09 mdh@just3ws-groupon:~/src/scratch jruby-1.6.4@APP_NAME ☱ rails new APP_NAME -m https://github.com/RailsApps/rails3-application-templates/raw/master/rails3-devise-rspec-cucumber-template.rb -T exist
identical README identical Rakefile identical config.ru identical .gitignore identical Gemfile exist app identical app/assets/images/rails.png identical app/assets/javascripts/application.js identical app/assets/stylesheets/application.css identical app/controllers/application_controller.rb identical app/helpers/application_helper.rb exist app/mailers exist app/models identical app/views/layouts/application.html.erb identical app/mailers/.gitkeep identical app/models/.gitkeep exist config identical config/routes.rb identical config/application.rb identical config/environment.rb exist config/environments identical config/environments/development.rb identical config/environments/production.rb identical config/environments/test.rb exist config/initializers identical config/initializers/backtrace_silencers.rb identical config/initializers/inflections.rb identical config/initializers/mime_types.rb conflict config/initializers/secret_token.rb Overwrite /Users/mdh/src/scratch/APP_NAME/config/initializers/secret_token.rb? (enter "h" for help) [Ynaqdh] Y force config/initializers/secret_token.rb identical config/initializers/session_store.rb identical config/initializers/wrap_parameters.rb exist config/locales identical config/locales/en.yml identical config/boot.rb identical config/database.yml exist db identical db/seeds.rb exist doc identical doc/README_FOR_APP exist lib exist lib/tasks identical lib/tasks/.gitkeep exist lib/assets identical lib/assets/.gitkeep exist log identical log/.gitkeep exist public identical public/404.html identical public/422.html identical public/500.html identical public/favicon.ico identical public/index.html identical public/robots.txt exist script identical script/rails exist tmp/cache exist tmp/cache/assets exist vendor/assets/stylesheets identical vendor/assets/stylesheets/.gitkeep exist vendor/plugins identical vendor/plugins/.gitkeep apply https://github.com/RailsApps/rails3-application-templates/raw/master/rails3-devise-rspec-cucumber-template.rb OpenSSL::SSL::SSLError: certificate verify failed connect at org/jruby/ext/openssl/SSLSocket.java:179 connect at /Users/mdh/.rvm/rubies/jruby-1.6.4/lib/ruby/1.8/net/http.rb:586 do_start at /Users/mdh/.rvm/rubies/jruby-1.6.4/lib/ruby/1.8/net/http.rb:553 start at /Users/mdh/.rvm/rubies/jruby-1.6.4/lib/ruby/1.8/net/http.rb:542 open_http at /Users/mdh/.rvm/rubies/jruby-1.6.4/lib/ruby/1.8/open-uri.rb:242 buffer_open at /Users/mdh/.rvm/rubies/jruby-1.6.4/lib/ruby/1.8/open-uri.rb:616 open_loop at /Users/mdh/.rvm/rubies/jruby-1.6.4/lib/ruby/1.8/open-uri.rb:164 catch at org/jruby/RubyKernel.java:1191 open_loop at /Users/mdh/.rvm/rubies/jruby-1.6.4/lib/ruby/1.8/open-uri.rb:162 open_uri at /Users/mdh/.rvm/rubies/jruby-1.6.4/lib/ruby/1.8/open-uri.rb:132 open at /Users/mdh/.rvm/rubies/jruby-1.6.4/lib/ruby/1.8/open-uri.rb:518 open at /Users/mdh/.rvm/rubies/jruby-1.6.4/lib/ruby/1.8/open-uri.rb:30 apply at /Users/mdh/.rvm/gems/jruby-1.6.4@APP_NAME/gems/thor-0.14.6/lib/thor/actions.rb:212 apply_rails_template at /Users/mdh/.rvm/gems/jruby-1.6.4@APP_NAME/gems/railties-3.1.0/lib/rails/generators/app_base.rb:109 apply_rails_template at (eval):1 send at org/jruby/RubyKernel.java:2092 run at /Users/mdh/.rvm/gems/jruby-1.6.4@APP_NAME/gems/thor-0.14.6/lib/thor/task.rb:21 invoke_task at /Users/mdh/.rvm/gems/jruby-1.6.4@APP_NAME/gems/thor-0.14.6/lib/thor/invocation.rb:118 invoke_all at /Users/mdh/.rvm/gems/jruby-1.6.4@APP_NAME/gems/thor-0.14.6/lib/thor/invocation.rb:124 each at /Users/mdh/.rvm/gems/jruby-1.6.4@APP_NAME/gems/thor-0.14.6/lib/thor/core_ext/ordered_hash.rb:75 collect at org/jruby/RubyEnumerable.java:706 invoke_all at /Users/mdh/.rvm/gems/jruby-1.6.4@APP_NAME/gems/thor-0.14.6/lib/thor/invocation.rb:124 dispatch at /Users/mdh/.rvm/gems/jruby-1.6.4@APP_NAME/gems/thor-0.14.6/lib/thor/group.rb:226 start at /Users/mdh/.rvm/gems/jruby-1.6.4@APP_NAME/gems/thor-0.14.6/lib/thor/base.rb:389 (root) at /Users/mdh/.rvm/gems/jruby-1.6.4@APP_NAME/gems/railties-3.1.0/lib/rails/commands/application.rb:31 require at org/jruby/RubyKernel.java:1038 require at /Users/mdh/.rvm/gems/jruby-1.6.4@APP_NAME/gems/railties-3.1.0/lib/rails/commands/application.rb:29 (root) at /Users/mdh/.rvm/gems/jruby-1.6.4@APP_NAME/gems/railties-3.1.0/lib/rails/cli.rb:15 require at org/jruby/RubyKernel.java:1038 require at /Users/mdh/.rvm/gems/jruby-1.6.4@APP_NAME/gems/railties-3.1.0/lib/rails/cli.rb:29 (root) at /Users/mdh/.rvm/gems/jruby-1.6.4@APP_NAME/gems/rails-3.1.0/bin/rails:7 load at org/jruby/RubyKernel.java:1063 (root) at /Users/mdh/.rvm/gems/jruby-1.6.4@APP_NAME/bin/rails:19 09:50:16 mdh@just3ws-groupon:~/src/scratch jruby-1.6.4@APP_NAME ☱

DanielKehoe commented 13 years ago

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

which will likely fail in the same way (if it doesn't, please reopen this issue and I will investigate further).

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

or the jRuby Google group: http://groups.google.com/group/jruby-users

I suspect there is a problem with jruby-openssl.

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 jRuby users who may run into the same problem.

-- Daniel

just3ws commented 13 years ago

Thanks, I tried to reproduce the error and you are correct. It's definitely a JRuby OpenSSL problem.