在 Snow Leopard 上安装 memcached gem 时出错 - 架构错误?
我在运行 OS X Snow Leopard (10.6.4) 的 Mac Pro 计算机上安装 memcached
ruby gem 时遇到问题。
Memcache 已安装并且工作正常,对于大多数项目,我使用 memcache-client
gem 没有问题,但当前项目我需要使用 memcached
gem。
使用 env ARCHFLAGS='-arch x86_64' gem install memcached
安装 gem 或仅通过正常的 gem install memcached
安装 gem 都会在尝试运行应用程序时给出相同的错误:
(in /src/mojotech/projectr)
dlopen(/Users/cpjolicoeur/.rvm/gems/ruby-1.8.7-p174/gems/memcached-0.19.7/lib/rlibmemcached.bundle, 9): no suitable image found.
Did find: /Users/cpjolicoeur/.rvm/gems/ruby-1.8.7-p174/gems/memcached-0.19.7/lib/rlibmemcached.bundle: mach-o, but wrong architecture - /Users/cpjolicoeur/.rvm/gems/ruby-1.8.7-p174/gems/memcached-0.19.7/lib/rlibmemcached.bundle
但是,在 rlibmemcached.bundle
上运行 file
会给出正确的架构吗?
cpjolicoeur@~/.rvm/gems/ruby-1.8.7-p174/gems/memcached-0.19.7/lib $ file rlibmemcached.bundle
rlibmemcached.bundle: Mach-O 64-bit bundle x86_64
我不确定问题是什么,或者如何为我的系统正确安装 memcached
gem。
I'm having an issue installing the memcached
ruby gem on my Mac Pro machine with OS X Snow Leopard (10.6.4).
Memcache is installed and working fine and for most projects I use the memcache-client
gem without issue, but this current project I need to use the memcached
gem instead.
Installing the gem with env ARCHFLAGS='-arch x86_64' gem install memcached
or just via the normal gem install memcached
both give the same error when trying to run the application:
(in /src/mojotech/projectr)
dlopen(/Users/cpjolicoeur/.rvm/gems/ruby-1.8.7-p174/gems/memcached-0.19.7/lib/rlibmemcached.bundle, 9): no suitable image found.
Did find: /Users/cpjolicoeur/.rvm/gems/ruby-1.8.7-p174/gems/memcached-0.19.7/lib/rlibmemcached.bundle: mach-o, but wrong architecture - /Users/cpjolicoeur/.rvm/gems/ruby-1.8.7-p174/gems/memcached-0.19.7/lib/rlibmemcached.bundle
However, running file
on the rlibmemcached.bundle
gives the correct arch?
cpjolicoeur@~/.rvm/gems/ruby-1.8.7-p174/gems/memcached-0.19.7/lib $ file rlibmemcached.bundle
rlibmemcached.bundle: Mach-O 64-bit bundle x86_64
I'm not sure what the problem is, or how to properly install the memcached
gem for my system.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我在 Snow Leopard、Ruby 1.9.1 和 memcached gem 上看到了同样的错误消息。我在网上搜索了几个小时才找到答案。每个人都建议这个解决方案,这并没有改变错误消息:
我还尝试执行“rake clean”并在 gem 上重新运行 extconf.rb。同样的错误。
最后,我浏览了 memcached gem 的每个过去版本,直到找到一个适合我的系统的版本。
gem 的 0.17.1 版本是唯一适合我的版本。我是一名 iPhone 开发人员,因此安装了最新版本的 XCode,这可能可以解释为什么我的系统有所不同。
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:
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.
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.
这是一个迟到的答案,但希望对遇到同样问题的人有用。 (在 Snow Leopard 上使用 Ruby 1.9.2。)
安装 Perl 模块 Pod::Simple、Pod::Man、Pod::Checker(通过 cpan 最简单)。
从 http://download.tangent.org/ 下载最新版本的 libmemcached(libmemcached-0.44.tar .gz 截至本文)
在终端中手动进行配置/制作/安装:
此后,
sudo gem install memcached
工作,并且相关的 Rails 3 应用程序运行良好。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:
After this,
sudo gem install memcached
worked, and the Rails 3 app in question ran fine.