diff options
author | Guillermo Iguaran <guilleiguaran@gmail.com> | 2012-09-07 12:15:31 -0500 |
---|---|---|
committer | Guillermo Iguaran <guilleiguaran@gmail.com> | 2012-09-07 12:15:31 -0500 |
commit | 9c0ab33c2edf0a20769b32c326b09da17c54ae4e (patch) | |
tree | da4d81c45448fe7b8b19501ea6774cdcb0bbf832 /actionpack/lib/action_dispatch/middleware/session | |
parent | f6f406696f01f000f1b873780648222fefe8bfce (diff) | |
download | rails-9c0ab33c2edf0a20769b32c326b09da17c54ae4e.tar.gz rails-9c0ab33c2edf0a20769b32c326b09da17c54ae4e.tar.bz2 rails-9c0ab33c2edf0a20769b32c326b09da17c54ae4e.zip |
Improve error message for memcache session store when dalli isn't loaded in app
Diffstat (limited to 'actionpack/lib/action_dispatch/middleware/session')
-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 |