Created
March 4, 2011 04:04
-
-
Save patrickarlt/854156 to your computer and use it in GitHub Desktop.
Sinatra Authentication Issue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'sinatra' | |
require 'haml' | |
require 'digest/sha1' | |
require 'rack-flash' | |
require 'mongoid' | |
require 'sinatra-authentication' | |
use Rack::Session::Cookie, :secret => 'skey' | |
use Rack::Flash | |
#MongoDB Config | |
Mongoid.configure do |config| | |
name = "blog" | |
host = "localhost" | |
config.master = Mongo::Connection.new.db(name) | |
config.slaves = [ | |
Mongo::Connection.new(host, 27017, :slave_ok => true).db(name) | |
] | |
config.persist_in_safe_mode = false | |
end | |
get '/' do | |
"Hello World" # -> Works | |
end | |
get '/haml' do | |
haml :test # -> Works | |
end | |
get '/private' do | |
login_required | |
'My Super Top-Secret Page' # -> Redirects to /login (Works) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'sinatra' | |
require './app.rb' | |
run Sinatra::Application |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Errno::ENOENT - No such file or directory - /opt/nginx/html/raptor.patrickarlt.com/views/layout.haml: | |
/usr/local/Cellar/ruby/1.9.2-p0/lib/ruby/gems/1.9.1/gems/tilt-1.2.2/lib/tilt.rb:109:in `binread' | |
/usr/local/Cellar/ruby/1.9.2-p0/lib/ruby/gems/1.9.1/gems/tilt-1.2.2/lib/tilt.rb:109:in `block in initialize' | |
/usr/local/Cellar/ruby/1.9.2-p0/lib/ruby/gems/1.9.1/gems/tilt-1.2.2/lib/tilt.rb:110:in `call' | |
/usr/local/Cellar/ruby/1.9.2-p0/lib/ruby/gems/1.9.1/gems/tilt-1.2.2/lib/tilt.rb:110:in `initialize' | |
/usr/local/Cellar/ruby/1.9.2-p0/lib/ruby/gems/1.9.1/gems/sinatra-1.1.2/lib/sinatra/base.rb:508:in `new' | |
/usr/local/Cellar/ruby/1.9.2-p0/lib/ruby/gems/1.9.1/gems/sinatra-1.1.2/lib/sinatra/base.rb:508:in `block in compile_template' | |
/usr/local/Cellar/ruby/1.9.2-p0/lib/ruby/gems/1.9.1/gems/tilt-1.2.2/lib/tilt.rb:344:in `fetch' | |
/usr/local/Cellar/ruby/1.9.2-p0/lib/ruby/gems/1.9.1/gems/sinatra-1.1.2/lib/sinatra/base.rb:489:in `compile_template' | |
/usr/local/Cellar/ruby/1.9.2-p0/lib/ruby/gems/1.9.1/gems/sinatra-1.1.2/lib/sinatra/base.rb:473:in `render' | |
/usr/local/Cellar/ruby/1.9.2-p0/lib/ruby/gems/1.9.1/gems/sinatra-1.1.2/lib/sinatra/base.rb:480:in `block in render' | |
/usr/local/Cellar/ruby/1.9.2-p0/lib/ruby/gems/1.9.1/gems/sinatra-1.1.2/lib/sinatra/base.rb:480:in `catch' | |
/usr/local/Cellar/ruby/1.9.2-p0/lib/ruby/gems/1.9.1/gems/sinatra-1.1.2/lib/sinatra/base.rb:480:in `render' | |
/usr/local/Cellar/ruby/1.9.2-p0/lib/ruby/gems/1.9.1/gems/sinatra-1.1.2/lib/sinatra/base.rb:390:in `haml' | |
/usr/local/Cellar/ruby/1.9.2-p0/lib/ruby/gems/1.9.1/gems/sinatra-authentication-0.4.1/lib/sinatra-authentication.rb:48:in `block in registered' | |
/usr/local/Cellar/ruby/1.9.2-p0/lib/ruby/gems/1.9.1/gems/sinatra-1.1.2/lib/sinatra/base.rb:1058:in `call' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%strong{:class => "code", :id => "message"} Hello HAML! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Were u able to solve this issue?