{"id":920,"date":"2022-08-30T15:09:23","date_gmt":"2022-08-30T15:09:23","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2013\/11\/09\/undefined-method-failure_app-for-nilnilclass-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:09:23","modified_gmt":"2022-08-30T15:09:23","slug":"undefined-method-failure_app-for-nilnilclass-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/undefined-method-failure_app-for-nilnilclass-collection-of-common-programming-errors\/","title":{"rendered":"Undefined method failure_app for nil:NilClass-Collection of common programming errors"},"content":{"rendered":"<p>I am trying to use devise from a Rails app to grant access to a Sinatra application within the Rack middleware.<\/p>\n<p>My config\/routes.rb has:<\/p>\n<pre><code>authenticate \"admin\" do\n  mount Admins::Dashboard, :at =&gt; \"\/admins\"                                                                                                        \nend\n<\/code><\/pre>\n<p>In my Sinatra app, I use:<\/p>\n<pre><code>before do\n  env[\"warden\"].authenticate!(:scope =&gt; \"admin\")                                                                                                 \nend\n\nget \"\/dashboard\" do\n  erb :dashboard\nend\n<\/code><\/pre>\n<p>Now, I get an error with the following stacktrace:<\/p>\n<pre><code>Started GET \"\/admins\/dashboard\" for 127.0.0.1 at 2012-10-11 08:45:13 +0200\n\nNoMethodError (undefined method `failure_app' for nil:NilClass):\n  devise (2.1.2) lib\/devise\/delegator.rb:11:in `failure_app'\n  devise (2.1.2) lib\/devise\/delegator.rb:5:in `call'\n  warden (1.2.1) lib\/warden\/manager.rb:130:in `call_failure_app'\n  warden (1.2.1) lib\/warden\/manager.rb:116:in `process_unauthenticated'\n  warden (1.2.1) lib\/warden\/manager.rb:47:in `call'\n  actionpack (3.2.8) lib\/action_dispatch\/middleware\/best_standards_support.rb:17:in `call'\n  rack (1.4.1) lib\/rack\/etag.rb:23:in `call'\n  rack (1.4.1) lib\/rack\/conditionalget.rb:25:in `call'\n<\/code><\/pre>\n<p id=\"rop\"><small>Originally posted 2013-11-09 22:58:19. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>I am trying to use devise from a Rails app to grant access to a Sinatra application within the Rack middleware. My config\/routes.rb has: authenticate &#8220;admin&#8221; do mount Admins::Dashboard, :at =&gt; &#8220;\/admins&#8221; end In my Sinatra app, I use: before do env[&#8220;warden&#8221;].authenticate!(:scope =&gt; &#8220;admin&#8221;) end get &#8220;\/dashboard&#8221; do erb :dashboard end Now, I get an [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-920","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/920","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=920"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/920\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=920"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=920"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=920"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}