diff options
author | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2012-09-07 10:30:23 -0700 |
---|---|---|
committer | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2012-09-07 10:30:23 -0700 |
commit | e371c6603541ffeae35d3388f39b853b0d372144 (patch) | |
tree | 40f0dc4692710b6d5db04aa56549c1ce04f37293 | |
parent | c24c885209ac2334dc6f798c394a821ee270bec6 (diff) | |
parent | 9c0ab33c2edf0a20769b32c326b09da17c54ae4e (diff) | |
download | rails-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.rb | 8 |
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 |