雪豹/ 64位红宝石宝石问题? [英] Snow Leopard / 64-bit ruby gem problem?

查看:88
本文介绍了雪豹/ 64位红宝石宝石问题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚升级到Snow Leopard,包括安装新的XCode,重新编译Ruby 1.8和MySQL。我的Rails应用程序在更新后的环境中运行良好,除了一些图像处理功能(取决于ImageScience / FreeImage)。



我将MacPorts升级到1.8,端口并将它们重新安装到1.8中,我认为它会安装64位版本的端口,包括FreeImage。我还使用以下方式将image_science和RubyInline重新安装为64位gem:



sudo env ARCHFLAGS = - arch x86_64gem install RubyInline image_science



现在,当我在需要图像处理的页面上运行我的应用程序时,我在我的日志中看到这个错误:



加载ImageScienceProcessor时出现问题:dlopen /myappname/config/initializers/../tmp/.ruby_inline/Inline_ImageScience_cdab.bundle,9):找不到合适的图像。找到:
/myappname/config/initializers/../tmp/.ruby_inline/Inline_ImageScience_cdab.bundle:mach-o,但架构错误 - /myappname/config/initializers/../tmp/.ruby_inline/Inline_ImageScience_cdab .bundle



有人可以帮我解释这个错误告诉我什么吗? 它报告说它试图执行一些本地代码,这是正确的可执行格式,但对于错误的体系结构。这可能意味着gem版本和正在运行的内核之间仍然存在不匹配,或者当您仍然安装旧操作系统时创建的临时代码仍然存在。两种可能的解决方案可能是:


  1. 备份应用程序,找到有问题的.ruby_inline目录并删除它,然后再试一次。
  2. 找出安装RubyInline和image_science宝石的位置(例如,gem list -d image_science),并检查它们的原始部分(通常是gem中的那些/ / lib或某物类似的,bin或扩展名为.so的)与您的内核相匹配。您可以使用文件工具来检查文件是32位还是64位可执行文件(只需调用 file filename )。

  3. ol>

    I just upgraded to Snow Leopard, including installing the new XCode, re-compiled Ruby 1.8 and MySQL. My Rails app is running fine in the updated environment, except for some image processing features, which depend on ImageScience/FreeImage.

    I upgraded MacPorts to 1.8, removed all previously installed ports and reinstalled them in 1.8, which I assume would have installed a 64-bit versions of the ports, including FreeImage. I also re-installed the image_science and RubyInline as 64-bit gems using:

    sudo env ARCHFLAGS="-arch x86_64" gem install RubyInline image_science

    Now when I run my app on pages that require image processing I get this error in my log:

    Problems loading ImageScienceProcessor: dlopen(/myappname/config/initializers/../tmp/.ruby_inline/Inline_ImageScience_cdab.bundle, 9): no suitable image found. Did find: /myappname/config/initializers/../tmp/.ruby_inline/Inline_ImageScience_cdab.bundle: mach-o, but wrong architecture - /myappname/config/initializers/../tmp/.ruby_inline/Inline_ImageScience_cdab.bundle

    Can someone help me out as to what this error is telling me?

    解决方案

    It reports that it tried to execute some native code, which was in the right executable format, but for the wrong architecture. This probably means that there is either still a mismatch between the gem version and the running kernel, or that some temporary code which was created when you still had your old operating system installed is still there. Two possible solutions might be:

    1. Make a backup of your application, find the offending ".ruby_inline" directory and delete it, then try again.
    2. Find out where the "RubyInline" and "image_science" gems are installed (e.g. gem list -d image_science) and check that their native parts (usually those within gems//lib or something similar, those in "bin" or those with a ".so" extension) match your kernel. You can use the "file" tool to examine whether a file is a 32 or 64 bit executable (simply call file filename).

    这篇关于雪豹/ 64位红宝石宝石问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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