在 Mac OS 10.6 和 10.6 上安装 wxruby 后出现问题,找不到合适的映像10.7&红帽
我正在尝试安装 wxruby。我尝试过 gem install wxruby、gem install wxruby-19-2.0.0 下载 wxruby-2.0.1-universal-darwin-9.gem。我尝试了 arch -i386 ruby 更改,但在不支持的架构的 arch 上出现错误(在 Snow Leopard 和 Lion 上)。
我已经在 Mac OS X Lion 和 Snow Leopard 上尝试过了。在 ruby 1.8.7 和 1.9.2 下。并且还在Linux(RED-HAT)上进行了尝试。所有人都给出了相同的错误。当我尝试编译它时,我遇到了一个 swig 版本错误,我修复了该错误,然后在代码中找不到 size_t 和其他项目的大量错误。我尝试了新安装的 wxwidgets(在 Snow Leopard 上),但这没有帮助。
它总是安装得很好,但是当我运行一些测试代码时,我得到: /Users/jwright/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in require': dlopen(/Users/jwright/.rvm/gems/ruby-1.9.2-p290/gems/wxruby-2.0.1-universal-darwin-9/lib/wxruby2.bundle, 9):找不到合适的图像。发现:(加载错误) /Users/jwright/.rvm/gems/ruby-1.9.2-p290/gems/wxruby-2.0.1-universal-darwin-9/lib/wxruby2.bundle:通用包装中没有匹配的架构 - /Users/jwright/.rvm/gems/ruby-1.9.2-p290/gems/wxruby-2.0.1-universal-darwin-9/lib/wxruby2.bundle 来自 /Users/jwright/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in
require' 来自 /Users/jwright/.rvm/gems/ruby-1.9.2-p290/gems/wxruby-2.0.1-universal-darwin-9/lib/wx.rb:12:in
require' 来自 /Users/jwright/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:59:in rescue in require' 来自 /Users/jwright/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:35:in
require' 来自 ./test_wxruby.rb:3:in `'
当我使用 irb 时它会做同样的事情 需要“红宝石” 需要“wx”
请帮忙。我真的很想用这个。我的另一个跨平台选择是 JRuby。
I am trying to install wxruby. I've tried gem install wxruby, gem install wxruby-19-2.0.0 downloading the wxruby-2.0.1-universal-darwin-9.gem. I tried the arch -i386 ruby change and got an error on arch of unsupported architecture (on Snow Leopard and Lion).
I've tried it on Mac OS X Lion and Snow Leopard. Under ruby 1.8.7 and 1.9.2. And also tried on Linux (RED-HAT). All gave the same error. When I tried to compile it I got a swig version error which I fixed and then ton's of errors in the code of not finding size_t and other items. I tried a new install of wxwidgets (on Snow Leopard) and that did not help.
It always installs fine but when I run some test code I get:
/Users/jwright/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in require': dlopen(/Users/jwright/.rvm/gems/ruby-1.9.2-p290/gems/wxruby-2.0.1-universal-darwin-9/lib/wxruby2.bundle, 9): no suitable image found. Did find: (LoadError)
require'
/Users/jwright/.rvm/gems/ruby-1.9.2-p290/gems/wxruby-2.0.1-universal-darwin-9/lib/wxruby2.bundle: no matching architecture in universal wrapper - /Users/jwright/.rvm/gems/ruby-1.9.2-p290/gems/wxruby-2.0.1-universal-darwin-9/lib/wxruby2.bundle
from /Users/jwright/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in
from /Users/jwright/.rvm/gems/ruby-1.9.2-p290/gems/wxruby-2.0.1-universal-darwin-9/lib/wx.rb:12:in <top (required)>'
require'
from /Users/jwright/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:59:in
from /Users/jwright/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:59:in rescue in require'
require'
from /Users/jwright/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:35:in
from ./test_wxruby.rb:3:in `'
It does the same thing when I use irb
require 'rubygems'
require 'wx'
Please help. I really want to use this. My other cross-platform option is JRuby.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是一个已知问题。从 Snow Laopard 开始,OSX 默认设置为 64 位 ruby。并且安装的gem是32位的。为了解决这个问题,请将以下 shebang 添加到您的 ruby 脚本中(它将强制脚本在 32 位 ruby 下执行):
It's a known issue. Starting with Snow Laopard, OSX ships with 64-bit ruby set as default. And installed gem is 32-bit. In order to fix this, add following shebang to your ruby script (it will force script to be executed under 32-bit ruby):