2

我尝试使用安装当前的 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 上运行。

难道我做错了什么?我怎样才能解决这个问题?

4

1 回答 1

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
于 2013-07-10T13:37:11.630 回答