title: Jruby with Devise
body: <p>I'm using devise-3.3.0 on jruby-1.7.13, I can't login or register when I hit /users/sign_up I get</p>
  
  <pre><code>ActionView::Template::Error (undefined method `new' for nil:NilClass):
  </code></pre>
  
  <p><strong>Stacktrace</strong></p>
  
  <pre><code>.rvm/gems/jruby-1.7.13/gems/devise-3.3.0/app/views/devise/registrations/new.html.erb within layouts/application (10.0ms)
  Completed 500 Internal Server Error in 27ms
  
  ActionView::Template::Error (undefined method `new' for nil:NilClass):
      1: &lt;h2&gt;Sign up&lt;/h2&gt;
      2:
      3: &lt;%= form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %&gt;
      4:   &lt;%= devise_error_messages! %&gt;
      5:
      6:   &lt;div&gt;&lt;%= f.label :email %&gt;&lt;br /&gt;
    actionview (4.1.4) lib/action_view/helpers/form_helper.rb:1146:in `instantiate_builder'
    actionview (4.1.4) lib/action_view/helpers/form_helper.rb:433:in `form_for'
    devise (3.3.0) app/views/devise/registrations/new.html.erb:3:in `___sers_magedmakled__rvm_gems_jruby________gems_devise_______app_views_devise_registrations_new_html_erb__1178479770_4328'
    actionview (4.1.4) lib/action_view/template.rb:145:in `render'
    activesupport (4.1.4) lib/active_support/notifications.rb:161:in `instrument'
    actionview (4.1.4) lib/action_view/template.rb:339:in `instrument'
    actionview (4.1.4) lib/action_view/template.rb:143:in `render'
    actionview (4.1.4) lib/action_view/renderer/template_renderer.rb:55:in `render_template'
    actionview (4.1.4) lib/action_view/renderer/abstract_renderer.rb:38:in `instrument'
    activesupport (4.1.4) lib/active_support/notifications.rb:159:in `instrument'
    activesupport (4.1.4) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
    activesupport (4.1.4) lib/active_support/notifications.rb:159:in `instrument'
    actionview (4.1.4) lib/action_view/renderer/abstract_renderer.rb:38:in `instrument'
    actionview (4.1.4) lib/action_view/renderer/template_renderer.rb:54:in `render_template'
    actionview (4.1.4) lib/action_view/renderer/template_renderer.rb:62:in `render_with_layout'
    actionview (4.1.4) lib/action_view/renderer/template_renderer.rb:53:in `render_template'
    actionview (4.1.4) lib/action_view/renderer/template_renderer.rb:17:in `render'
    actionview (4.1.4) lib/action_view/renderer/renderer.rb:42:in `render_template'
    actionview (4.1.4) lib/action_view/renderer/renderer.rb:23:in `render'
    actionview (4.1.4) lib/action_view/rendering.rb:99:in `_render_template'
    actionpack (4.1.4) lib/action_controller/metal/streaming.rb:217:in `_render_template'
    actionview (4.1.4) lib/action_view/rendering.rb:82:in `render_to_body'
    actionpack (4.1.4) lib/action_controller/metal/rendering.rb:32:in `render_to_body'
    actionpack (4.1.4) lib/action_controller/metal/renderers.rb:32:in `render_to_body'
    actionpack (4.1.4) lib/abstract_controller/rendering.rb:25:in `render'
    actionpack (4.1.4) lib/action_controller/metal/rendering.rb:16:in `render'
    actionpack (4.1.4) lib/action_controller/metal/instrumentation.rb:41:in `render'
    activesupport (4.1.4) lib/active_support/core_ext/benchmark.rb:12:in `ms'
    /Users/magedmakled/.rvm/rubies/jruby-1.7.8/lib/ruby/1.9/benchmark.rb:295:in `realtime'
    activesupport (4.1.4) lib/active_support/core_ext/benchmark.rb:12:in `ms'
    actionpack (4.1.4) lib/action_controller/metal/instrumentation.rb:41:in `render'
    actionpack (4.1.4) lib/action_controller/metal/instrumentation.rb:84:in `cleanup_view_runtime'
    activerecord (4.1.4) lib/active_record/railties/controller_runtime.rb:25:in `cleanup_view_runtime'
    actionpack (4.1.4) lib/action_controller/metal/instrumentation.rb:40:in `render'
    actionpack (4.1.4) lib/action_controller/metal/implicit_render.rb:10:in `default_render'
    actionpack (4.1.4) lib/action_controller/metal/responder.rb:238:in `default_render'
    actionpack (4.1.4) lib/action_controller/metal/responder.rb:165:in `to_html'
    actionpack (4.1.4) lib/action_controller/metal/responder.rb:158:in `respond'
    actionpack (4.1.4) lib/action_controller/metal/responder.rb:151:in `call'
    actionpack (4.1.4) lib/action_controller/metal/mime_responds.rb:400:in `respond_with'
    devise (3.3.0) app/controllers/devise/registrations_controller.rb:12:in `new'
    actionpack (4.1.4) lib/action_controller/metal/implicit_render.rb:4:in `send_action'
    actionpack (4.1.4) lib/abstract_controller/base.rb:189:in `process_action'
    actionpack (4.1.4) lib/action_controller/metal/rendering.rb:10:in `process_action'
    actionpack (4.1.4) lib/abstract_controller/callbacks.rb:20:in `process_action'
    org/jruby/RubyProc.java:271:in `call'
    activesupport (4.1.4) lib/active_support/callbacks.rb:113:in `call'
    activesupport (4.1.4) lib/active_support/callbacks.rb:229:in `halting'
    org/jruby/RubyProc.java:271:in `call'
    activesupport (4.1.4) lib/active_support/callbacks.rb:229:in `halting'
    org/jruby/RubyProc.java:271:in `call'
    activesupport (4.1.4) lib/active_support/callbacks.rb:166:in `halting'
    org/jruby/RubyProc.java:271:in `call'
    activesupport (4.1.4) lib/active_support/callbacks.rb:166:in `halting'
    org/jruby/RubyProc.java:271:in `call'
    activesupport (4.1.4) lib/active_support/callbacks.rb:166:in `halting'
    org/jruby/RubyProc.java:271:in `call'
    activesupport (4.1.4) lib/active_support/callbacks.rb:166:in `halting'
    org/jruby/RubyProc.java:271:in `call'
    activesupport (4.1.4) lib/active_support/callbacks.rb:149:in `halting_and_conditional'
    org/jruby/RubyProc.java:271:in `call'
    activesupport (4.1.4) lib/active_support/callbacks.rb:149:in `halting_and_conditional'
    org/jruby/RubyProc.java:271:in `call'
    activesupport (4.1.4) lib/active_support/callbacks.rb:86:in `run_callbacks'
    actionpack (4.1.4) lib/abstract_controller/callbacks.rb:19:in `process_action'
    actionpack (4.1.4) lib/action_controller/metal/rescue.rb:29:in `process_action'
    actionpack (4.1.4) lib/action_controller/metal/instrumentation.rb:31:in `process_action'
    activesupport (4.1.4) lib/active_support/notifications.rb:159:in `instrument'
    activesupport (4.1.4) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
    activesupport (4.1.4) lib/active_support/notifications.rb:159:in `instrument'
    actionpack (4.1.4) lib/action_controller/metal/instrumentation.rb:30:in `process_action'
    actionpack (4.1.4) lib/action_controller/metal/params_wrapper.rb:250:in `process_action'
    activerecord (4.1.4) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
    actionpack (4.1.4) lib/abstract_controller/base.rb:136:in `process'
    actionview (4.1.4) lib/action_view/rendering.rb:30:in `process'
    actionpack (4.1.4) lib/action_controller/metal.rb:196:in `dispatch'
    actionpack (4.1.4) lib/action_controller/metal/rack_delegation.rb:13:in `dispatch'
    actionpack (4.1.4) lib/action_controller/metal.rb:232:in `action'
    org/jruby/RubyProc.java:271:in `call'
    actionpack (4.1.4) lib/action_dispatch/routing/route_set.rb:82:in `dispatch'
    actionpack (4.1.4) lib/action_dispatch/routing/route_set.rb:50:in `call'
    actionpack (4.1.4) lib/action_dispatch/routing/mapper.rb:45:in `call'
    actionpack (4.1.4) lib/action_dispatch/journey/router.rb:71:in `call'
    org/jruby/RubyArray.java:1613:in `each'
    actionpack (4.1.4) lib/action_dispatch/journey/router.rb:59:in `call'
    actionpack (4.1.4) lib/action_dispatch/routing/route_set.rb:678:in `call'
    warden (1.2.3) lib/warden/manager.rb:35:in `call'
    org/jruby/RubyKernel.java:1284:in `catch'
    warden (1.2.3) lib/warden/manager.rb:34:in `call'
    rack (1.5.2) lib/rack/etag.rb:23:in `call'
    rack (1.5.2) lib/rack/conditionalget.rb:25:in `call'
    rack (1.5.2) lib/rack/head.rb:11:in `call'
    actionpack (4.1.4) lib/action_dispatch/middleware/params_parser.rb:27:in `call'
    actionpack (4.1.4) lib/action_dispatch/middleware/flash.rb:254:in `call'
    rack (1.5.2) lib/rack/session/abstract/id.rb:225:in `context'
    rack (1.5.2) lib/rack/session/abstract/id.rb:220:in `call'
    actionpack (4.1.4) lib/action_dispatch/middleware/cookies.rb:560:in `call'
    activerecord (4.1.4) lib/active_record/query_cache.rb:36:in `call'
    activerecord (4.1.4) lib/active_record/connection_adapters/abstract/connection_pool.rb:621:in `call'
    activerecord (4.1.4) lib/active_record/migration.rb:380:in `call'
    actionpack (4.1.4) lib/action_dispatch/middleware/callbacks.rb:29:in `call'
    activesupport (4.1.4) lib/active_support/callbacks.rb:82:in `run_callbacks'
    actionpack (4.1.4) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
    actionpack (4.1.4) lib/action_dispatch/middleware/reloader.rb:73:in `call'
    actionpack (4.1.4) lib/action_dispatch/middleware/remote_ip.rb:76:in `call'
    actionpack (4.1.4) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
    actionpack (4.1.4) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
    railties (4.1.4) lib/rails/rack/logger.rb:38:in `call_app'
    railties (4.1.4) lib/rails/rack/logger.rb:20:in `call'
    activesupport (4.1.4) lib/active_support/tagged_logging.rb:68:in `tagged'
    activesupport (4.1.4) lib/active_support/tagged_logging.rb:26:in `tagged'
    activesupport (4.1.4) lib/active_support/tagged_logging.rb:68:in `tagged'
    railties (4.1.4) lib/rails/rack/logger.rb:20:in `call'
    actionpack (4.1.4) lib/action_dispatch/middleware/request_id.rb:21:in `call'
  </code></pre>
  
  <p><strong>my routes</strong> </p>
  
  <pre><code>new_user_session GET    /users/sign_in(.:format)       devise/sessions#new
              user_session POST   /users/sign_in(.:format)       devise/sessions#create
      destroy_user_session DELETE /users/sign_out(.:format)      devise/sessions#destroy
             user_password POST   /users/password(.:format)      devise/passwords#create
         new_user_password GET    /users/password/new(.:format)  devise/passwords#new
        edit_user_password GET    /users/password/edit(.:format) devise/passwords#edit
                           PATCH  /users/password(.:format)      devise/passwords#update
                           PUT    /users/password(.:format)      devise/passwords#update
  cancel_user_registration GET    /users/cancel(.:format)        devise/registrations#cancel
         user_registration POST   /users(.:format)               devise/registrations#create
     new_user_registration GET    /users/sign_up(.:format)       devise/registrations#new
    edit_user_registration GET    /users/edit(.:format)          devise/registrations#edit
                           PATCH  /users(.:format)               devise/registrations#update
                           PUT    /users(.:format)               devise/registrations#update
                           DELETE /users(.:format)               devise/registrations#destroy
                  articles GET    /articles(.:format)            articles#index
                           POST   /articles(.:format)            articles#create
               new_article GET    /articles/new(.:format)        articles#new
              edit_article GET    /articles/:id/edit(.:format)   articles#edit
                   article GET    /articles/:id(.:format)        articles#show
                           PATCH  /articles/:id(.:format)        articles#update
                           PUT    /articles/:id(.:format)        articles#update
                           DELETE /articles/:id(.:format)        articles#destroy
             welcome_index GET    /welcome/index(.:format)       welcome#index
                      root GET    /                              welcome#index
  </code></pre>