Rails or Ruby Memcached Gem on Ubuntu and Linux

Get the following error when trying to install memcached ruby gem on your Ubuntu or Linux box?

rlibmemcached_wrap.c: In function ‘_wrap_memcached_get_sasl_callbacks’:
rlibmemcached_wrap.c:12413: error: ‘sasl_callback_t’ undeclared (first use in this function)
rlibmemcached_wrap.c:12413: error: ‘result’ undeclared (first use in this function)
rlibmemcached_wrap.c:12424: error: expected expression before ‘)’ token
rlibmemcached_wrap.c: In function ‘Init_rlibmemcached’:
rlibmemcached_wrap.c:13694: error: ‘SASL_OK’ undeclared (first use in this function)
make: *** [rlibmemcached_wrap.o] Error 1

Gem files will remain installed in /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/memcached-1 for inspection.
Results logged to /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/memcached-1/ext/gem_make.out

Quick fix

sudo apt-get install libsasl2-dev libsasl2-dev

Then delete the gem folder with the current memcached stuff in it, for me that is

sudo rm -rf /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/memcached-1

THEN

sudo gem install memcached

Posted on October 13, 2010 at 9:26 am by Jordan Carter · Permalink
In: Ruby on Rails, Server Config, Ubuntu Tricks · Tagged with: , ,

2 Responses

  1. Written by Dagan Durdik
    on October 16, 2010 at 9:05 am
    Permalink

    Worked for me. Thanks for sharing.

  2. Written by Tobias
    on October 25, 2010 at 12:26 am
    Permalink

    Thankyou, this really helped me out.

Leave a Reply