aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Calavera <david.calavera@gmail.com>2010-06-21 18:19:12 +0200
committerXavier Noria <fxn@hashref.com>2010-06-22 16:28:29 +0200
commitb8330a22619f647f16a671c1ad58730d8896f806 (patch)
tree119c08843bf1a8a642861724656072adf38d1a5d
parent256a33d0fb78cb4fb337938c82a52d042dd4fa2a (diff)
downloadrails-b8330a22619f647f16a671c1ad58730d8896f806.tar.gz
rails-b8330a22619f647f16a671c1ad58730d8896f806.tar.bz2
rails-b8330a22619f647f16a671c1ad58730d8896f806.zip
preventing memcached initialization errors with default servers list [#4921 state:resolved]
As of this writing the JRuby client does not support a default port. Signed-off-by: Xavier Noria <fxn@hashref.com>
-rw-r--r--activesupport/lib/active_support/cache/mem_cache_store.rb2
-rw-r--r--activesupport/test/abstract_unit.rb2
2 files changed, 2 insertions, 2 deletions
diff --git a/activesupport/lib/active_support/cache/mem_cache_store.rb b/activesupport/lib/active_support/cache/mem_cache_store.rb
index e3a2688e2f..3c46ae5424 100644
--- a/activesupport/lib/active_support/cache/mem_cache_store.rb
+++ b/activesupport/lib/active_support/cache/mem_cache_store.rb
@@ -35,7 +35,7 @@ module ActiveSupport
def self.build_mem_cache(*addresses)
addresses = addresses.flatten
options = addresses.extract_options!
- addresses = ["localhost"] if addresses.empty?
+ addresses = ["localhost:11211"] if addresses.empty?
MemCache.new(addresses, options)
end
diff --git a/activesupport/test/abstract_unit.rb b/activesupport/test/abstract_unit.rb
index b032331a0b..6db21f9e12 100644
--- a/activesupport/test/abstract_unit.rb
+++ b/activesupport/test/abstract_unit.rb
@@ -25,7 +25,7 @@ require 'active_support/ruby/shim' if RUBY_VERSION < '1.8.7'
def uses_memcached(test_name)
require 'memcache'
begin
- MemCache.new('localhost').stats
+ MemCache.new('localhost:11211').stats
yield
rescue MemCache::MemCacheError
$stderr.puts "Skipping #{test_name} tests. Start memcached and try again."