在Snow Leopard上安装memcached gem时出错 - 错误的架构? [英] Error installing memcached gem on Snow Leopard - wrong architecture?

查看:115
本文介绍了在Snow Leopard上安装memcached gem时出错 - 错误的架构?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在安装OS X Snow Leopard(10.6.4)的Mac Pro机器上安装 memcached ruby​​ gem的问题。



Memcache已安装并正常工作,对于大多数使用 memcache-client gem的项目,没有问题,但是需要使用此当前项目 memcached gem代替。



使用 env安装gem ARCHFLAGS =' - arch x86_64' gem install memcached 或者只是通过普通的 gem install memcached 在尝试运行应用程序时都会出现相同的错误:

 (in / src / mojotech / projectr)
dlopen(/Users/cpjolicoeur/.rvm/gems/ruby-1.8.7-p174/ gems / memcached-0.19.7 / lib / rlibmemcached.bundle,9):找不到合适的图像。
找到了:/Users/cpjolicoeur/.rvm/gems/ruby-1.8.7-p174/gems/memcached-0.19.7/lib/rlibmemcached.bundle:mach-o,但是架构错误 - / Users / cpjolicoeur / .rvm / gems / ruby​​-1.8.7-p174 / gems / memcached-0.19.7 / lib / rlibmemcached.bundle

但是,在 rlibmemcached.bundle 上运行文件是否会给出正确的arch?

  cpjolicoeur@~/.rvm/gems/ruby-1.8.7-p174/gems/memcached-0.19.7/lib $ file rlibmemcached .bundle 
rlibmemcached.bundle:Mach-O 64位软件包x86_64

我是不知道是什么问题,或者如何正确地为我的系统安装 memcached gem。

解决方案

我在Snow Leopard,Ruby 1.9.1和memcached gem上看到了相同的确切错误信息。我在网上搜索了几个小时以获得答案。每个人都提出了这个解决方案,它并没有改变错误信息:

 #没有工作
sudo gem uninstall
sudo env ARCHFLAGS =' - arch x86_64'gem install memcached

我也试着做'rake clean '并重新运行gem上的extconf.rb。同样的错误。

最后,我浏览了每一个memcached gem的过去版本,直到找到一个可以与我的系统兼容的版本。

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

宝石版本0.17.1是唯一适用于我的版本。我是一名iPhone开发人员,因此安装了最新版本的XCode,这也许可以解释为什么我的系统不同。

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.

解决方案

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.

这篇关于在Snow Leopard上安装memcached gem时出错 - 错误的架构?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆