You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using Rabl with Grape and gem version 0.11.2 and later don't seem to work for me. I tried to figure out what the problem could be, and it seems that something was introduced while refactoring code in 0.11.2 version. Following is a partial stack trace:
As far as I can tell It seems like that Rabl tries to call fetch_sinatra_source, but since the provided context_scope is Grape it fails because there is no views setting for Grape. The simple fix that I tried was replacing:
in the fetch_source method in Rabl::Sources module and everything seemed to work. And just to be clear Sinatra is a dependency of another gem that I'm using which is why defined?(Sinatra) check passes. I do not use it in conjunction with Rabl.
The text was updated successfully, but these errors were encountered:
I'm using Rabl with Grape and gem version 0.11.2 and later don't seem to work for me. I tried to figure out what the problem could be, and it seems that something was introduced while refactoring code in 0.11.2 version. Following is a partial stack trace:
As far as I can tell It seems like that Rabl tries to call
fetch_sinatra_source
, but since the provided context_scope is Grape it fails because there is noviews
setting for Grape. The simple fix that I tried was replacing:elsif defined?(Sinatra) && context_scope.respond_to?(:settings)
withelsif defined?(Sinatra) && context_scope.respond_to?(:settings) && context_scope.settings.respond_to?(:views)
in the
fetch_source
method inRabl::Sources
module and everything seemed to work. And just to be clear Sinatra is a dependency of another gem that I'm using which is whydefined?(Sinatra)
check passes. I do not use it in conjunction with Rabl.The text was updated successfully, but these errors were encountered: