Search code examples
rubylinuxruby-2.1libgosu

unable to install Gosu library in Ruby in Linux


I am getting this error when I am trying to install gosu on Ubuntu 13.10

Fetching gem metadata from https://rubygems.org/.........
Fetching version metadata from https://rubygems.org/..
Resolving dependencies...
Using diff-lcs 1.2.5

Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

        /usr/bin/ruby1.9.1 extconf.rb 
The Gosu gem requires some libraries to be installed system-wide.
See the following site for a list:
https://github.com/jlnr/gosu/wiki/Getting-Started-on-Linux

checking for TTF_RenderUTF8_Blended() in -lSDL2_ttf... yes
checking for SDL_ttf.h... yes
checking for FreeImage_ConvertFromRawBits() in -lfreeimage... yes
checking for FreeImage.h... yes
checking for main() in -lopenal... no
creating Makefile

make
compiling gosu_wrap.cxx
In file included from /usr/include/ruby-1.9.1/ruby.h:32:0,
                 from gosu_wrap.cxx:850:
gosu_wrap.cxx: In function ‘void Gosu::loadBitmap(Gosu::Bitmap&, VALUE)’:
/usr/include/ruby-1.9.1/ruby/ruby.h:675:31: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
      RSTRING(str)->as.heap.len)
                               ^

I tried adding every library from https://github.com/jlnr/gosu/wiki/Getting-Started-on-Linux, but I am still getting the above error. Can anyone please help me with this?

Edited: When I check for status of installed packages as

 dpkg -s gcc libsdl2-dev libsdl2-ttf-dev libpango1.0-dev libgl1-mesa-dev libfreeimage-dev libopenal-dev libsndfile-dev | grep Status

I get the following status:

Status: install ok installed
dpkg-query: package 'libsdl2-ttf-dev' is not installed and no information is available
Status: install ok installed
Status: install ok installed
Status: install ok installed
dpkg-query: package 'libopenal-dev' is not installed and no information is available
Status: install ok installed
dpkg-query: package 'libsndfile-dev' is not installed and no information is available
Use dpkg --info (= dpkg-deb --info) to examine archive files,
and dpkg --contents (= dpkg-deb --contents) to list their contents.

So, libsdl2-ttf-dev and libsndfile-dev are not installed. I tried installing these packages with apt-get install, but was unable to install them as it says the packages could not be found in any sources.


Solution

  • are you sure all of dependencies are installed correctly ?

    first please check them :

    dpkg -s gcc libsdl2-dev libsdl2-ttf-dev libpango1.0-dev libgl1-mesa-dev libfreeimage-dev libopenal-dev libsndfile-dev | grep Status
    

    then , you can check the problem easily ! you have to check the install log file :

    you can open the file with editor like vi , nano , or cat , tail ... , I've used nano

    nano /var/lib/gems/*/gems/*/ext/gosu/gem_make.out
    

    move to end of the file and check why make the script stopped ! post the Error Here , then i can help you for resolve the issue !