Error installing memcached gem on Snow Leopard - wrong architecture?

血红的双手。 提交于 2019-12-04 21:08:53

I was seeing the same exact error message on Snow Leopard, Ruby 1.9.1, and the memcached gem. I scoured the net for hours for an answer. Everyone suggested this solution, which did not change the error message:

# Did Not Work
sudo gem uninstall
sudo env ARCHFLAGS='-arch x86_64' gem install memcached

I also tried doing 'rake clean' and re-running extconf.rb on the gem. Same error.

Finally, I went through every past version of the memcached gem until I found one that worked with my system.

# This Worked!
sudo gem uninstall memcached
sudo gem install --version 0.17.1 memcached --no-ri --no-rdoc

Version 0.17.1 of the gem is the only version that works for me. I'm an iPhone developer, so have the latest version of XCode installed, and this might explain why my system is different.

This is a late answer, but hopefully useful for someone who runs across the same issue. (With Ruby 1.9.2 on Snow Leopard.)

Install the Perl modules Pod::Simple, Pod::Man, Pod::Checker (via cpan is easiest).

Download the latest version of libmemcached from http://download.tangent.org/ (was libmemcached-0.44.tar.gz as of this post)

Do the configure/make/install dance by hand in Terminal:

tar -xzvf libmemcached-0.44.tar.gz
cd libmemcached-0.44
./configure
make
sudo make install

After this, sudo gem install memcached worked, and the Rails 3 app in question ran fine.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!