Question

I tried installing the current Rubygame gem using

sudo gem install rubygame

While the installation worked normally, when I tried to require the gem, Ruby raised the following error:

/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>'

I run on Ubuntu 13.04.

Am I doing something wrong? How can I fix this?

Was it helpful?

Solution

Try installing these packages:

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
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top