Hi I'm having trouble setting up my Rails project on my server because apache keeps complaining
DalliError: No server available
.
I installed memcached
on my ubuntu machine, but it still doesn't work. My rails project also has config.cache_store = :dalli_store, 'localhost:11211', { :namespace => "production" }
in environments/production.rb. How would I debug this?
My log shows before each request:
localhost:11211 failed (count: 6)
DalliError: No server available
telnet to 11211:
root@s2:/usr/local/www/production/current/log# telnet localhost 11211
Trying 127.0.1.1...
telnet: Unable to connect to remote host: Connection refused
I had the same problem.
First I installed memcached as a gem
gem install memcached
and got the error "DalliError: No server available"
Then I installed memcached by doing
sudo apt-get install memcached
.
It works fine now.
If you're a Homebrew user:
brew install memcached
Check if the service is running:
brew services list
If not, start it:
brew services start memcached
It was because someone changed the /etc/hosts
file to point 127.0.1.1
to localhost instead of 127.0.0.1
. After changing that, memcached
worked.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With