Skip to content

Commit

Permalink
Improve error message for memcache session store when dalli isn't loa…
Browse files Browse the repository at this point in the history
…ded in app
  • Loading branch information
guilleiguaran committed Sep 7, 2012
1 parent f6f4066 commit 9c0ab33
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
require 'action_dispatch/middleware/session/abstract_store'
require 'rack/session/dalli'
begin
require 'rack/session/dalli'
rescue LoadError => e
$stderr.puts "You don't have dalli installed in your application. Please add it to your Gemfile and run bundle install"
raise e
end

module ActionDispatch
module Session
Expand All @@ -9,7 +14,6 @@ class MemCacheStore < Rack::Session::Dalli
include SessionObject

def initialize(app, options = {})
require 'dalli'
options[:expire_after] ||= options[:expires]
super
end
Expand Down

0 comments on commit 9c0ab33

Please sign in to comment.