本文介绍了无法成功安装rubygame的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的操作系统是OSX 10.8.2。我遵循了和
所有内容的指示在我的安装过程中可以。然而,当我在ruby脚本中需要rubygame时,会发生一些事情:

  irb(main):001:0> require'rubygame'
ArgumentError:回调不能有可变参数
来自/Library/Ruby/Gems/1.8/gems/ffi-1.2.0/lib/ffi/library.rb:365:in`callback '从/Library/Ruby/Gems/1.8/gems/ruby-sdl-ffi-0.4/lib/ruby-sdl-ffi/sdl/mac.rb:161 $ b $ / from / System / Library / Frameworks / Ruby.framework / Versions / 1.8 / usr / lib / ruby​​ / 1.8 / ruby​​gems / custom_require.rb:31:在`gem_original_require'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/ usr / lib / ruby​​ / 1.8 / ruby​​gems / custom_require.rb:31:在'require'中
从/Library/Ruby/Gems/1.8/gems/ruby-sdl-ffi-0.4/lib/ruby-sdl- ffi / sdl.rb:/Library/Ruby/Gems/1.8/gems/ruby-sdl-ffi-0.4/lib/ruby-sdl-ffi/sdl.rb:80:80中的
:每个$从/Library/Ruby/Gems/1.8/gems/ruby-sdl-ffi-0.4/lib/ruby-sdl-ffi/sdl.rb:67 $ b $ / from / System / Library / Frameworks / Ruby获得b $ b。 framework / Versions / 1.8 / usr / lib / ruby​​ / 1.8 / ruby​​gems / custom_require.rb:31:在`gem_original_require'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib /ruby/1.8/rubygems/custom_require.rb:31:in`require'
from /Library/Ruby/Gems/1.8/gems/rubygame-2.6.4/lib/rubygame/main.rb:22 $ b从/系统/库/框架/ RB /框架/ Ruby.framework / Versions / 1.8 / usr / lib / ruby​​ / 1.8 / ruby​​gems / custom_require.rb:31:在'require'中
从/Library/Ruby/Gems/1.8/gems/rubygame-2.6.4/ lib / ruby​​game.rb:/Library/Ruby/Gems/1.8/gems/rubygame-2.6.4/lib/rubygame.rb:29:44中的
:/ library / Ruby中的每个
/Gems/1.8/gems/rubygame-2.6.4/lib/rubygame.rb:29 $ b $ from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/ custom_require.rb:36:在`gem_original_require'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:36:in`require'

我应该怎么做?

解决方案

为我修好了。但基本上ruby-sdl-ffi和Rubygame看起来没有维护。我建议不要使用它们,除非有人采用这些项目。


my os is OSX 10.8.2. i have followed the instructions from rubygame wiki, andeverything is ok during my installation. However, when I require the rubygame in my ruby script, something happend:

    irb(main):001:0> require 'rubygame'
    ArgumentError: callbacks cannot have variadic parameters
from /Library/Ruby/Gems/1.8/gems/ffi-1.2.0/lib/ffi/library.rb:365:in `callback'
from /Library/Ruby/Gems/1.8/gems/ruby-sdl-ffi-0.4/lib/ruby-sdl-ffi/sdl/mac.rb:161
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `require'
from /Library/Ruby/Gems/1.8/gems/ruby-sdl-ffi-0.4/lib/ruby-sdl-ffi/sdl.rb:80
from /Library/Ruby/Gems/1.8/gems/ruby-sdl-ffi-0.4/lib/ruby-sdl-ffi/sdl.rb:67:in `each'
from /Library/Ruby/Gems/1.8/gems/ruby-sdl-ffi-0.4/lib/ruby-sdl-ffi/sdl.rb:67
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `require'
from /Library/Ruby/Gems/1.8/gems/rubygame-2.6.4/lib/rubygame/main.rb:22
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `require'
from /Library/Ruby/Gems/1.8/gems/rubygame-2.6.4/lib/rubygame.rb:44
from /Library/Ruby/Gems/1.8/gems/rubygame-2.6.4/lib/rubygame.rb:29:in `each'
from /Library/Ruby/Gems/1.8/gems/rubygame-2.6.4/lib/rubygame.rb:29
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:36:in `require'

what should i do?

解决方案

This fixed it for me. But basically ruby-sdl-ffi and Rubygame look unmaintained. I would recommend against using them unless someone adopts these projects.

这篇关于无法成功安装rubygame的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-25 11:08