Rails + Dalli memcache gem: DalliError: No server available

后端 未结 6 1549
你的背包
你的背包 2021-02-12 11:59

Hi I\'m having trouble setting up my Rails project on my server because apache keeps complaining

DalliError: No server available.

I installed

6条回答
  •  忘了有多久
    2021-02-12 12:08

    The accepted answer will probably solve the issue for 95% of people who are seeing this error, but in my case I found the issue to be far more fundamental:

    From the server, I was unable to ping 127.0.0.1. This meant Dalli could not connect to the memcache server, which by default runs on 127.0.0.1:11211.

    There are a number of things that could cause this issue, but the most likely is simply a missing network interface. If you run ifconfig, you should see something like this in the output:

    lo        Link encap:Local Loopback  
              inet addr:127.0.0.1  Mask:255.0.0.0
              inet6 addr: ::1/128 Scope:Host
              UP LOOPBACK RUNNING  MTU:65536  Metric:1
              RX packets:15686 errors:0 dropped:0 overruns:0 frame:0
              TX packets:15686 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1 
              RX bytes:23730314 (23.7 MB)  TX bytes:23730314 (23.7 MB)
    

    If this is missing, ensure your /etc/network/interfaces file contains the following local interface definition:

    auto lo
    iface lo inet loopback
    

    And then restart the networking service:

    sudo /etc/init.d/networking restart
    

提交回复
热议问题