在Mac OS 10.6和Mac OS 10.6上安装wxruby,找不到合适的图像后出现问题10.7&红帽

时间:2011-08-12 22:47:30

标签: user-interface rubygems wxruby

我正在尝试安装wxruby。我已经尝试了gem install wxruby,gem install wxruby-19-2.0.0下载了wxruby-2.0.1-universal-darwin-9.gem。我尝试了arch -i386 ruby​​更改并在不受支持的体系结构(在Snow Leopard和Lion上)上出现错误。

我在Mac OS X Lion和Snow Leopard上尝试过它。在红宝石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): no suitable image found. Did find: (LoadError) /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 require'     来自/Users/jwright/.rvm/gems/ruby-1.9.2-p290/gems/wxruby-2.0.1-universal-darwin-9/lib/wx.rb:12:in <top (required)>' from /Users/jwright/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:59: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' from /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:在''

当我使用irb时它做同样的事情 要求'rubygems' 要求'wx'

请帮忙。我真的想用这个。我的另一个跨平台选项是JRuby。

1 个答案:

答案 0 :(得分:1)

这是一个已知问题。从Snow Laopard开始,OSX默认配置64位ruby。并且安装的gem是32位的。为了解决这个问题,请将以下shebang添加到ruby脚本中(它将强制脚本在32位ruby下执行):

#!/usr/bin/env arch -i386 ruby

require 'rubygems'
# This will work thanks to arch -i386
require 'wx'