ruby - मैं '2.1 में अपरिचित दृश्य पथ पाया' को कैसे ठीक करूँ?

original title: "ruby - How do I fix 'Unprocessed view path found' error with ExceptionNotifier plugin in rails 2.1?"


After upgrading a rails 1.2 website to 2.1, the ExceptionNotifier plugin no longer works, complaining about this error:

ActionView::TemplateFinder::InvalidViewPath: Unprocessed view path found: "/path/to/appname/vendor/plugins/exception_notification/lib/../views". Set your view paths with #append_view_path, #prepend_view_path, or #view_paths=.

What causes it and how do I fix it?

1.2 वेबसाइट को 2.1 पर अपग्रेड करने के बाद, ExceptionNotifier plugin काम नहीं करता है, इस त्रुटि के बारे में शिकायत करता है: ActionView :: TemplateFinder :: InvalidViewPath: Unprocessed view path fo ...

यह अनुवाद के बाद का सारांश है, अगर आपको पूरा अनुवाद देखने की आवश्यकता है, तो कृपया 'अनुवाद' आइकन पर क्लिक करें

सभी उत्तर
  • Translate

    You ought to upgrade to the newest Exception Notification plugin which is in its new home at GitHub.

  • Translate

    This was caused by a change in rails 2.1 which prevents rails from loading views from any arbitrary path for security reasons.

    There is now an updated version of the plugin on github, so the solution is to use that.

    The old solution here for posterity

    To work around it, edit init.rb under your vendor/plugins/exception_notification directory, and add the following code to the end

    ActionController::Base.class_eval do
      append_view_path File.dirname(__FILE__) + '/lib/../views'

    This adds the ExceptionNotifier plugins' views folder to the list, so it is allowed to load them.