Rubygame不工作:'load_library':无法加载SDL

时间:2013-07-10 12:30:46

标签: ruby rubygame

我尝试使用

安装当前的Rubygame gem
sudo gem install rubygame

虽然安装正常,但当我尝试要求gem时,Ruby引发了以下错误:

/var/lib/gems/1.9.1/gems/nice-ffi-0.4/lib/nice-ffi/library.rb:98:in 'load_library': Could not load SDL. (LoadError)
    from /var/lib/gems/1.9.1/gems/ruby-sdl-ffi-0.4/lib/ruby-sdl-ffi/sdl.rb:51:in '<module:SDL>'
    from /var/lib/gems/1.9.1/gems/ruby-sdl-ffi-0.4/lib/ruby-sdl-ffi/sdl.rb:34:in '<top (required)>'
    from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in 'require'
    from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in 'require'
    from /var/lib/gems/1.9.1/gems/rubygame-2.6.4/lib/rubygame/main.rb:22:in '<top (required)>'
    from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in 'require'
    from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in 'require'
    from /var/lib/gems/1.9.1/gems/rubygame-2.6.4/lib/rubygame.rb:44:in 'block in <top (required)>'
    from /var/lib/gems/1.9.1/gems/rubygame-2.6.4/lib/rubygame.rb:29:in 'each'
    from /var/lib/gems/1.9.1/gems/rubygame-2.6.4/lib/rubygame.rb:29:in '<top (required)>'
    from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:60:in 'require'
    from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:60:in 'rescue in require'
    from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:35:in 'require'
    from /home/lakerking008/Ruby/Ruby Game Practice/Game.rb:2:in '<main>'

我在Ubuntu 13.04上运行。

我做错了吗?我该如何解决这个问题?

1 个答案:

答案 0 :(得分:2)

尝试安装这些软件包:

sudo apt-get install ruby ruby-dev irb ri rubygems
sudo apt-get install libsdl1.2-dev libsdl-gfx1.2-dev libsdl-image1.2-dev libsdl-mixer1.2-dev libsdl-ttf2.0-dev