我想在Mac (10.7.2)上使用memcached宝石(http://fauna.github.com/fauna/memcached/)。Xcode 4.2已经安装。
我安装了memcached,libmemcached由Homebrew安装。
$ brew list -v
libmemcached 0.50
memcached 1.4.10我在rvm (ruby版本管理器)中使用ruby 1.9.3-p0。
$ 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 (全部)失败了。
$ 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宝石安装到Lion :/
Postscript-1
我试过"brew链接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.10Postscript-2
我尝试了删除/usr/local/c业力/memcached/。并运行'brew链接memcached',但得到以下错误。
$ rm -rf memcached
$ brew link memcached
Error: No such keg: /usr/local/Cellar/memcached发布于 2011-11-30 06:39:52
这样做:
ls -l /usr/local/include/memcached
lrwxr-xr-x 1 root staff 43 Jul 18 14:17 /usr/local/include/memcached -> ../Cellar/memcached/1.4.5/include/memcached您需要先删除这个旧链接:
sudo rm /usr/local/include/memcached然后再尝试brew link memcached
您可能还想这样做:
Installed memcached via homebrew, how to start and stop server?
发布于 2011-11-30 05:59:09
我认为问题是gcc找不到由brew安装的memcached库。
尝试运行brew link memcached,然后再次运行gem install memcached。
https://stackoverflow.com/questions/8321687
复制相似问题