开发者

sinatra-authentication gem not looking for correct views?

I am attempting to write a small blogging engine for myself in sinatra and mongoid and am trying to use the sinatra-authentication gem to do login/out.

I have gotten sinatra, mongoid, and haml all working but when I visit any sinatra-authentication page nginx throws an internal server error.

this is the error I am getting

Errno::ENOENT - No such file or directory -     /opt/nginx/html/raptor.patrickarlt.com/views/layout.haml:

you can see all my files including more from my nginx 开发者_Python百科error log here https://gist.github.com/854156

get '/' works confirming Sinatra is working

get '/haml' works confirming haml is working

get '/private' redirects to '/login' confirming sinatra-authentication is working

get '/login' internal server error

Ruby 1.9.2

Nginx 0.8.54

Passenger 3.0.2


sinatra-authentication assumes you're using a layout unless the current request is an XMLHttpRequest (see the code). You have two options:

  1. Create a layout for your application in views/layout.haml as described a couple paragraphs down at http://sinatra-book.gittr.com/#templates
  2. Override sinatra-authentication's use_layout? method as such:

    module Sinatra
      module Helpers
        def use_layout?
          false
        end
      end
    end
    
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜