Libmemcached already built; run ‘rake clean’ first if you need to rebuild.


memcachedをインストールした後、memcached gemをインストールすると、次のような問題が発生します.解決方法は次のとおりです.
  • ruby/gems/1.8/gems/ディレクトリの下でmemcachedのインストールディレクトリmemcached-1.2を削除する.5、あるネットユーザーはgem uninstall memcachedを使って削除すると言ったが、私は試用して
  • に成功しなかった.
  • sudo apt-get install libmemcached-dev libsasl2-dev libmemcached-dbg
  • sudo gem install memcached
  • 
    sudo gem install memcached
    Building native extensions.  This could take a while…
    ERROR:  Error installing memcached:
    ERROR: Failed to build gem native extension.
    /opt/ruby-enterprise-1.8.7-2010.02/bin/ruby extconf.rb
    Libmemcached already built; run ‘rake clean’ first if you need to rebuild.
    creating Makefile
    make
    gcc -I. -I/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/1.8/x86_64-linux -I/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/1.8/x86_64-linux -I.  -fPIC  -I/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/memcached-0.19.7/ext/include  -L/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/memcached-0.19.7/ext/lib -g -O2    -g -O2    -c rlibmemcached_wrap.c
    rlibmemcached_wrap.c: In function ‘_wrap_MemcachedSt_sasl_callbacks_set’:
    rlibmemcached_wrap.c:6678: error: ‘sasl_callback_t’ undeclared (first use in this function)
    rlibmemcached_wrap.c:6678: error: (Each undeclared identifier is reported only once
    rlibmemcached_wrap.c:6678: error: for each function it appears in.)
    rlibmemcached_wrap.c:6678: error: ‘arg2’ undeclared (first use in this function)
    rlibmemcached_wrap.c:6678: error: expected expression before ‘)’ token
    rlibmemcached_wrap.c:6696: error: expected expression before ‘)’ token
    rlibmemcached_wrap.c:6697: error: ‘struct memcached_st’ has no member named ‘sasl_callbacks’
    rlibmemcached_wrap.c:6697: error: expected ‘)’ before ‘const’
    rlibmemcached_wrap.c:6697: error: expected ‘;’ before ‘arg2’
    rlibmemcached_wrap.c: In function ‘_wrap_MemcachedSt_sasl_callbacks_get’:
    rlibmemcached_wrap.c:6709: error: ‘sasl_callback_t’ undeclared (first use in this function)
    rlibmemcached_wrap.c:6709: error: ‘result’ undeclared (first use in this function)
    rlibmemcached_wrap.c:6720: error: expected expression before ‘)’ token
    rlibmemcached_wrap.c:6720: error: ‘struct memcached_st’ has no member named ‘sasl_callbacks’
    rlibmemcached_wrap.c: In function ‘_wrap_memcached_set_sasl_callbacks’:
    rlibmemcached_wrap.c:12030: error: ‘sasl_callback_t’ undeclared (first use in this function)
    rlibmemcached_wrap.c:12030: error: ‘arg2’ undeclared (first use in this function)
    rlibmemcached_wrap.c:12030: error: expected expression before ‘)’ token
    rlibmemcached_wrap.c:12048: error: expected expression before ‘)’ token
    rlibmemcached_wrap.c:12049: error: expected ‘)’ before ‘const’
    rlibmemcached_wrap.c:12049: error: expected ‘)’ before ‘arg2’
    rlibmemcached_wrap.c: In function ‘_wrap_memcached_get_sasl_callbacks’:
    rlibmemcached_wrap.c:12131: error: ‘sasl_callback_t’ undeclared (first use in this function)
    rlibmemcached_wrap.c:12131: error: ‘result’ undeclared (first use in this function)
    rlibmemcached_wrap.c:12142: error: expected expression before ‘)’ token
    rlibmemcached_wrap.c: In function ‘Init_rlibmemcached’:
    rlibmemcached_wrap.c:13344: 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-0.19.7 for inspection.
    Results logged to /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/memcached-0.19.7/ext/gem_make.out
    sudo gem install memcachedBuilding native extensions.  This could take a while…ERROR:  Error installing memcached:	ERROR: Failed to build gem native extension.
    /opt/ruby-enterprise-1.8.7-2010.02/bin/ruby extconf.rbLibmemcached already built; run ‘rake clean’ first if you need to rebuild.creating Makefile
    makegcc -I. -I/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/1.8/x86_64-linux -I/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/1.8/x86_64-linux -I.  -fPIC  -I/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/memcached-0.19.7/ext/include  -L/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/memcached-0.19.7/ext/lib -g -O2    -g -O2    -c rlibmemcached_wrap.crlibmemcached_wrap.c: In function ‘_wrap_MemcachedSt_sasl_callbacks_set’:rlibmemcached_wrap.c:6678: error: ‘sasl_callback_t’ undeclared (first use in this function)rlibmemcached_wrap.c:6678: error: (Each undeclared identifier is reported only oncerlibmemcached_wrap.c:6678: error: for each function it appears in.)rlibmemcached_wrap.c:6678: error: ‘arg2’ undeclared (first use in this function)rlibmemcached_wrap.c:6678: error: expected expression before ‘)’ tokenrlibmemcached_wrap.c:6696: error: expected expression before ‘)’ tokenrlibmemcached_wrap.c:6697: error: ‘struct memcached_st’ has no member named ‘sasl_callbacks’rlibmemcached_wrap.c:6697: error: expected ‘)’ before ‘const’rlibmemcached_wrap.c:6697: error: expected ‘;’ before ‘arg2’rlibmemcached_wrap.c: In function ‘_wrap_MemcachedSt_sasl_callbacks_get’:rlibmemcached_wrap.c:6709: error: ‘sasl_callback_t’ undeclared (first use in this function)rlibmemcached_wrap.c:6709: error: ‘result’ undeclared (first use in this function)rlibmemcached_wrap.c:6720: error: expected expression before ‘)’ tokenrlibmemcached_wrap.c:6720: error: ‘struct memcached_st’ has no member named ‘sasl_callbacks’rlibmemcached_wrap.c: In function ‘_wrap_memcached_set_sasl_callbacks’:rlibmemcached_wrap.c:12030: error: ‘sasl_callback_t’ undeclared (first use in this function)rlibmemcached_wrap.c:12030: error: ‘arg2’ undeclared (first use in this function)rlibmemcached_wrap.c:12030: error: expected expression before ‘)’ tokenrlibmemcached_wrap.c:12048: error: expected expression before ‘)’ tokenrlibmemcached_wrap.c:12049: error: expected ‘)’ before ‘const’rlibmemcached_wrap.c:12049: error: expected ‘)’ before ‘arg2’rlibmemcached_wrap.c: In function ‘_wrap_memcached_get_sasl_callbacks’:rlibmemcached_wrap.c:12131: error: ‘sasl_callback_t’ undeclared (first use in this function)rlibmemcached_wrap.c:12131: error: ‘result’ undeclared (first use in this function)rlibmemcached_wrap.c:12142: error: expected expression before ‘)’ tokenrlibmemcached_wrap.c: In function ‘Init_rlibmemcached’:rlibmemcached_wrap.c:13344: 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-0.19.7 for inspection.Results logged to /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/memcached-0.19.7/ext/gem_make.out