aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2012-09-07 10:30:23 -0700
committerCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2012-09-07 10:30:23 -0700
commite371c6603541ffeae35d3388f39b853b0d372144 (patch)
tree40f0dc4692710b6d5db04aa56549c1ce04f37293
parentc24c885209ac2334dc6f798c394a821ee270bec6 (diff)
parent9c0ab33c2edf0a20769b32c326b09da17c54ae4e (diff)
downloadrails-e371c6603541ffeae35d3388f39b853b0d372144.tar.gz
rails-e371c6603541ffeae35d3388f39b853b0d372144.tar.bz2
rails-e371c6603541ffeae35d3388f39b853b0d372144.zip
Merge pull request #7565 from guilleiguaran/dalli-session-store
Improve error message for memcache session store when dalli isn't loaded
-rw-r--r--actionpack/lib/action_dispatch/middleware/session/mem_cache_store.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/actionpack/lib/action_dispatch/middleware/session/mem_cache_store.rb b/actionpack/lib/action_dispatch/middleware/session/mem_cache_store.rb
index 14af7eef68..b4d6629c35 100644
--- a/actionpack/lib/action_dispatch/middleware/session/mem_cache_store.rb
+++ b/actionpack/lib/action_dispatch/middleware/session/mem_cache_store.rb
@@ -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
@@ -9,7 +14,6 @@ module ActionDispatch
include SessionObject
def initialize(app, options = {})
- require 'dalli'
options[:expire_after] ||= options[:expires]
super
end