मैं अपने रेल ऐप के लिए डेविस का उपयोग करने का प्रयास करता हूं। मैं साइन अप और प्रवेश, लेकिन जब मैं अपने अन्य पृष्ठ पर जाएं "का निर्माण" मैं निम्न त्रुटि प्राप्त कर सकते हैं:सहायक उपकरण: अनुरोध पर्यावरण पर 'वार्डन :: प्रॉक्सी' उदाहरण नहीं मिला
class ApplicationController < ActionController::Base
protect_from_forgery with: :exception
private
# Overwriting the sign_out redirect path method
def after_sign_out_path_for(resource_or_scope)
build_path
end
end
यहाँ मेरी दो आंशिक दृश्य वजह:
Devise::MissingWarden in Home#show Devise could not find the
Warden::Proxy
instance on your request environment. Make sure that your application is loading Devise and Warden as expected and that theWarden::Manager
middleware is present in your middleware stack. If you are seeing this on one of your tests, ensure that your tests are either executing the Rails middleware stack or that your tests are using theDevise::Test::ControllerHelpers
module to inject therequest.env['warden']
object for you.
यहाँ मेरी नियंत्रक है
<!-- views/devise/menu/_login_items.html.erb -->
<% if user_signed_in? %>
<li>
<%= link_to('Logout', destroy_user_session_path, :method => :delete) %>
</li>
<% else %>
<li>
<%= link_to('Login', new_user_session_path) %>
</li>
<% end %>
और
<!-- views/devise/menu/_registration_items.html.erb -->
<% if user_signed_in? %>
<li>
<%= link_to('Edit registration', edit_user_registration_path) %>
</li>
<% else %>
<li>
<%= link_to('Register', new_user_registration_path) %>
</li>
<% end %>
डीबगिंग के बाद, मुझे पता चला कि समस्या मेरे "शो" नियंत्रक में इस लाइन से आ रही है: टेम्पलेट = होम कंट्रोलर.रेंडर ('लेआउट/_ टेम्पलेट')
आपकी मदद के लिए धन्यवाद।
क्या यह तब होता है जब आप स्थानीय रूप से ऐप चलाते हैं, या जब आप अपना परीक्षण सूट चलाते हैं? –