4

I am trying to install Gosu on my Ubuntu computer. To install the gem i have tried "gem install gosu" but I am getting an Error message I cannot figure out.. It says it "Failed to build gem native extension".

Anyone know what I can do? I am kinda new to Ruby so it might have to do something with the RVM..? Im not sure.

Here is the full error message:

Fetching: gosu-0.8.6.gem (100%)
Building native extensions.  This could take a while...
ERROR:  Error installing gosu:
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:
/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- mkmf (LoadError)
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from extconf.rb:63:in `<main>'
https://github.com/jlnr/gosu/wiki/Getting-Started-on-Linux

Gem files will remain installed in /var/lib/gems/1.9.1/gems/gosu-0.8.6 for inspection.
Results logged to /var/lib/gems/1.9.1/gems/gosu-0.8.6/ext/gosu/gem_make.out
Shotgun Ninja
  • 2,540
  • 3
  • 26
  • 32
Salviati
  • 758
  • 2
  • 9
  • 28
  • That message is a generic start to a longer error message. Can you provide the rest of the error so we can better assist please? – aspencer8111 Jan 14 '15 at 21:07
  • take a look at [this question](http://stackoverflow.com/questions/7645918/require-no-such-file-to-load-mkmf-loaderror) – WarHog Jan 14 '15 at 21:12
  • Absolutely! Added it now. – Salviati Jan 14 '15 at 21:13
  • The error code looks almost identical. Will just read it through. – Salviati Jan 14 '15 at 21:16
  • I have read the question and also the instructions here: https://github.com/jlnr/gosu/wiki/Getting-Started-on-Linux witch can be found in the error code. But I cannot "solve" it. I keep getting the same error. – Salviati Jan 14 '15 at 21:28
  • Are you sure that you've installed all needed packages noticed there? I mean libsdl2-dev, libsdl2-ttf-dev, libpango1.0-dev, libgl1-mesa-dev, libfreeimage-dev, libopenal-dev, libsndfile-dev. Just for sure double-check it - e.g. with `dpkg-query -l ` – WarHog Jan 14 '15 at 22:23
  • I installed them, now I get another error message. ERROR: Could not find a valid gem 'goso' (>= 0) in any repository ERROR: Possible alternatives: godo, gogo, goo, gosh, gosu – Salviati Jan 14 '15 at 22:37
  • Hmm - as I can see gem is entitled `gosu` not `goso` :) – WarHog Jan 14 '15 at 22:41

1 Answers1

2

Do this

Step 1:

sudo apt-get install build-essential libsdl2-dev libsdl2-ttf-dev libpango1.0-dev \
                 libgl1-mesa-dev libopenal-dev libsndfile-dev libmpg123-dev

Step2:

sudo apt-get install ruby-dev

Step 3:

gem install gosu