我想在 Mac OS X Lion (10.7.2) 上使用 memcached gem (http://fauna.github.com/fauna/memcached/)。Xcode 4.2 已经安装。
我已经安装了 Memcached 和 Homebrew 的 libmemcached。
$ brew list -v
libmemcached 0.50
memcached 1.4.10
我使用 ruby 1.9.3-p0 和 rvm(ruby 版本管理器)。
$ ruby -v
ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-darwin11.2.0]
$ rvm -v
rvm 1.9.2 by Wayne E. Seguin (wayneeseguin@gmail.com) [https://rvm.beginrescueend.com/]
但我无法安装 memcached gem (1.3.5)。我在 gits 之后粘贴了安装日志。 https://gist.github.com/1395459
在构建 libmemcached 时发生了一些错误。我看到了那个目录。
$ pwd
/Users/inohiro/.rvm/gems/ruby-1.9.3-p0/gems/memcached-1.3.5/ext/libmemcached-0.32
配置成功。但是 make (all) 失败了。
$ make all
make all-recursive
Making all in docs
make[2]: Nothing to be done for `all'.
Making all in libmemcached
make all-am
make[3]: Nothing to be done for `all-am'.
Making all in libmemcachedutil
make[2]: Nothing to be done for `all'.
Making all in support
make[2]: Nothing to be done for `all'.
Making all in clients
/bin/sh ../libtool --tag=CC --mode=link gcc -std=gnu99 -O3 -pedantic -Wall -Wextra -Wundef -Wshadow -fdiagnostics-show-option -fvisibility=hidden -Wformat=2 -Wstrict-aliasing -Wstrict-prototypes -Wmissing-prototypes -Wredundant-decls -Wmissing-declarations -Wcast-align -Wswitch-default -Wswitch-enum -Wwrite-strings -D_THREAD_SAFE -rpath /usr/local/lib/libmemcached -lsasl2 -L/usr/local/lib -o memcat memcat.o libutilities.la ../libmemcached/libmemcached.la
libtool: link: gcc -std=gnu99 -O3 -pedantic -Wall -Wextra -Wundef -Wshadow -fdiagnostics-show-option -fvisibility=hidden -Wformat=2 -Wstrict-aliasing -Wstrict-prototypes -Wmissing-prototypes -Wredundant-decls -Wmissing-declarations -Wcast-align -Wswitch-default -Wswitch-enum -Wwrite-strings -D_THREAD_SAFE -o .libs/memcat memcat.o -L/usr/local/lib ./.libs/libutilities.a ../libmemcached/.libs/libmemcached.dylib -lsasl2
Undefined symbols for architecture x86_64:
"_memcached_create", referenced from:
_main in memcat.o
"_memcached_behavior_set", referenced from:
_main in memcat.o
_process_hash_option in libutilities.a(utilities.o)
"_memcached_get", referenced from:
_main in memcat.o
"_memcached_free", referenced from:
_main in memcat.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
make[2]: *** [memcat] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
libmemcached 的配置和制作的完整日志在这里。 https://gist.github.com/1395470
请告诉我如何将 memcached gem 安装到 Lion:/
后记-1
我试过“brew link memcached”。但是返回一个错误。我该怎么办?
$ brew link memcached
Linking /usr/local/Cellar/memcached/1.4.10...
Error: Cannot link memcached
Another version is already linked: /usr/local/Cellar/memcached/1.4.10
后记-2
我尝试删除 /usr/local/Cellar/memcached/。并运行“brew link memcached”,但出现以下错误。
$ rm -rf memcached
$ brew link memcached
Error: No such keg: /usr/local/Cellar/memcached