Not logged inGosu Forums
Forum back to libgosu.org Help Search Register Login
Up Topic Gosu / Gosu Exchange / Ubuntu 14.04 quick start
- - By webdevdude Date 2014-09-16 13:21 Edited 2014-09-16 13:31
This was tested on an AMD 64, Ubuntu 14.04, apt-get updates as of date of this post.

All-in-one:

sudo apt-get update
sudo apt-get upgrade
\curl -sSL https://get.rvm.io | bash -s stable --rails
rvm install ruby 1.9 --default
sudo apt-get install build-essential libsdl2-dev libsdl2-ttf-dev libpango1.0-dev libgl1-mesa-dev libfreeimage-dev libopenal-dev libsndfile-dev libiconv-hook-dev libxml2-dev freeglut3 freeglut3-dev ImageMagick libmagickwand-dev
gem install faster_xml_simple
gem install gosu releasy texplay ashton gamebox chipmunk ruby-opengl rmagick

***

Step-by-step:

First and foremost, make sure you have updated core software:

>: sudo apt-get update
>: sudo apt-get upgrade


If there are no ruby/rails installed (rails is entirely optional)

First get RVM (w/rails):

>: \curl -sSL https://get.rvm.io | bash -s stable --rails


Without rails:

>: \curl -sSL https://get.rvm.io | bash -s stable --ruby


Then install ruby 1.9.  Having ruby 2+ is ok, relax you'll probably want it eventually. But for now, install and set your default to 1.9:

>: rvm install ruby 1.9 --default


You'll need some build tools and sort out some dependencies

>: sudo apt-get install build-essential libsdl2-dev libsdl2-ttf-dev libpango1.0-dev libgl1-mesa-dev libfreeimage-dev libopenal-dev libsndfile-dev libiconv-hook-dev libxml2-dev freeglut3 freeglut3-dev ImageMagick libmagickwand-dev


An odd thing happens and you need a gem that fails to install. It looks like a broken source link in another gem that depends on faster_xml_simple.

>: gem install faster_xml_simple


Then install Gosu and the currently maintained extensions. After Gosu, the rest are optional, but they should all work at this point.

>: gem install gosu releasy texplay ashton gamebox chipmunk ruby-opengl rmagick


***

That's it! That should get anyone from zero to ruby+gosu game development very quickly on Ubuntu 14.04, but if anything fails on x86, or elsewhere, please comment and let me know.

Hope this helps anyone on Ubuntu,

~wdd
Parent - - By jlnr (dev) Date 2014-09-16 22:20
Thanks for the write-up :) I have also linked it right from the wiki page: https://github.com/jlnr/gosu/wiki/Getting-Started-on-Linux
Parent - By webdevdude Date 2014-09-17 09:25
Cool!
Parent - By RavensKrag Date 2014-09-29 15:32
As a note for anyone who comes here in the future from the wiki, and wonders why they would want to go through the trouble of installing ruby this way (using RVM) rather than the "standard way" (installing the package through using apt-get):

RVM allows you to install multiple versions of Ruby in a sane way. For example, If you want to start with 1.9, and then move to 2.0 later, then RVM may be a cleaner solution than using the packages in Ubuntu's repository.

Why? Because Ubuntu's packages (as well as the Debian packages they are derived from) pack different versions of Ruby under different packages. This means that you would call ruby19 or ruby20 rather than just calling ruby.  If you would rather not have to think about the version number every time, using RVM is a good choice.

RVM will also change out the gems for you, so when you switch to using 1.9, one set of gems will be active, and when you use 2.0 (or some other version) a separate set with be used. This is especially useful when you try to upgrade to a newer version of Ruby, only to realize that the gems you need aren't updated yet. With RVM, it's super easy to just go back to using your old setup.
Parent - - By RavensKrag Date 2014-09-29 15:34
I think you may have to install curl. I don't think that comes standard with Ubuntu, but sometimes you end up installing things that list curl as a dependency, end up having it when you need it (especially when you do a lot of programming)

if you need it, just grab it through apt:

>: sudo apt-get install curl

Parent - By webdevdude Date 2014-09-29 16:41
Nope, it is one of the default packages for 14.04 LTS

http://packages.ubuntu.com/trusty/web/

>curl (7.35.0-1ubuntu2.1) [security]
>    command line tool for transferring data with URL syntax

Parent - - By Amulya Shahi Date 2015-07-12 07:15
Hello there,
I need help, I tried installing gosu on my ubuntu 14.04 it came up with this error.. 

amulya@SHAHI:~$ gem install gosu
Building native extensions.  This could take a while...
ERROR:  Error installing gosu:
  ERROR: Failed to build gem native extension.

    /home/amulya/.rvm/rubies/ruby-2.2.0/bin/ruby -r ./siteconf20150712-1819-nvwpk3.rb 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... no
checking for FreeImage_ConvertFromRawBits() in -lfreeimage... no
checking for main() in -lopenal... no
creating Makefile

make "DESTDIR=" clean

make "DESTDIR="
compiling gosu_wrap.cxx
In file included from ../../Gosu/Gosu.hpp:21:0,
                 from gosu_wrap.cxx:2175:
../../Gosu/Input.hpp:20:22: fatal error: X11/Xlib.h: No such file or directory
#include <X11/Xlib.h>
                      ^
compilation terminated.
make: *** [gosu_wrap.o] Error 1

make failed, exit code 2

Gem files will remain installed in /home/amulya/.rvm/gems/ruby-2.2.0/gems/gosu-0.9.2 for inspection.
Results logged to /home/amulya/.rvm/gems/ruby-2.2.0/extensions/x86_64-linux/2.2.0/gosu-0.9.2/gem_make.out
amulya@SHAHI:~$

--------------------------------------------------------------------------------------------------------------------------------=========================================================================

So I updated and then upgraded, since I already have rails installed .. ..

I tried this... .


amulya@SHAHI:~$ sudo apt-get install build-essential libsdl2-dev libsdl2-ttf-dev libpango1.0-dev libgl1-mesa-dev libfreeimage-dev libopenal-dev libsndfile-dev libiconv-hook-dev libxml2-dev freeglut3 freeglut3-dev ImageMagick libmagickwand-dev
[sudo] password for amulya:
Reading package lists... Done
Building dependency tree      
Reading state information... Done
Note, selecting 'libsndfile1-dev' instead of 'libsndfile-dev'
build-essential is already the newest version.
imagemagick is already the newest version.
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
libcogl15 : Depends: libegl1-mesa-drivers
libmagickwand-dev : Depends: libmagickcore-dev (= 8:6.7.7.10-6ubuntu3) but it is not going to be installed
libpango1.0-dev : Depends: libpango-1.0-0 (= 1.36.3-1ubuntu1) but 1.36.3-1ubuntu1.1 is to be installed
                   Depends: libpangocairo-1.0-0 (= 1.36.3-1ubuntu1) but 1.36.3-1ubuntu1.1 is to be installed
                   Depends: libpangoft2-1.0-0 (= 1.36.3-1ubuntu1) but 1.36.3-1ubuntu1.1 is to be installed
                   Depends: libpangoxft-1.0-0 (= 1.36.3-1ubuntu1) but 1.36.3-1ubuntu1.1 is to be installed
                   Depends: gir1.2-pango-1.0 (= 1.36.3-1ubuntu1) but 1.36.3-1ubuntu1.1 is to be installed
                   Depends: libglib2.0-dev (>= 2.34.0) but it is not going to be installed
                   Depends: libxft-dev but it is not going to be installed
                   Depends: libfontconfig1-dev (>= 2.10.91) but it is not going to be installed
                   Depends: libharfbuzz-dev (>= 0.9.9) but it is not going to be installed
                   Depends: libcairo2-dev (>= 1.12.10) but it is not going to be installed
                   Recommends: debhelper but it is not going to be installed
libsdl2-dev : Depends: libegl1-mesa-dev
               Depends: libgles2-mesa-dev
               Depends: libpulse-dev but it is not going to be installed
               Depends: libudev-dev but it is not going to be installed
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.
amulya@SHAHI:~$

Thanks..
Parent - - By jlnr (dev) Date 2015-07-12 10:57
Ooops, thank you for reporting this! I've left a few references to unused libraries in Gosu 0.8+. I've committed a fix right now, and Gosu 0.9.3 will not try to #include <X11/Xlib.h anymore. Sorry for the trouble.

In the meantime, does the top answer here solve the problem for you?

http://stackoverflow.com/questions/5299989/x11-xlib-h-not-found-in-ubuntu
Parent - - By Amulya Shahi Date 2015-07-13 05:43
thank you.. !!

I have already tried the above updates and installations..

It did not..

=============================
Then I tried after updating the bundler..
        and then when I tried  =>  sudo apt-get install gosu

it came up with  this >

amulya@SHAHI:~$ sudo apt-get install gosu
Reading package lists... Done
Building dependency tree      
Reading state information... Done
E: Unable to locate package gosu
amulya@SHAHI:~$

Thanks..!!
Parent - - By jlnr (dev) Date 2015-07-13 07:21
Gosu is not in apt-get (yet ;) ). Please try gem install gosu instead.

Has the error message changed after sudo apt-get install libx11-dev (from StackOverflow)?
Parent - - By Amulya Shahi Date 2015-07-14 06:11
Thanks... when tried "gem install gosu"  it came up with this error

amulya@SHAHI:~$ gem install gosu
Fetching: gosu-0.9.2.gem (100%)
Building native extensions.  This could take a while...
ERROR:  Error installing gosu:
  ERROR: Failed to build gem native extension.

    /home/amulya/.rvm/rubies/ruby-2.2.1/bin/ruby -r ./siteconf20150714-5173-1680r2l.rb 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... no
checking for FreeImage_ConvertFromRawBits() in -lfreeimage... no
checking for main() in -lopenal... no
creating Makefile

make "DESTDIR=" clean

make "DESTDIR="
compiling gosu_wrap.cxx
In file included from ../../Gosu/Gosu.hpp:21:0,
                 from gosu_wrap.cxx:2175:
../../Gosu/Input.hpp:20:22: fatal error: X11/Xlib.h: No such file or directory
#include <X11/Xlib.h>
                      ^
compilation terminated.
make: *** [gosu_wrap.o] Error 1

make failed, exit code 2

Gem files will remain installed in /home/amulya/.rvm/gems/ruby-2.2.1/gems/gosu-0.9.2 for inspection.
Results logged to /home/amulya/.rvm/gems/ruby-2.2.1/extensions/x86_64-linux/2.2.0/gosu-0.9.2/gem_make.out
amulya@SHAHI:~$

then I tried

amulya@SHAHI:~$ sudo apt-get install build-essential libsd12-dev libsd12-ttf-dev libpango1.0-dev libgl1-mesa-dev libfreeimage-dev libopenal-dev libsndfile1-dev
Reading package lists... Done
Building dependency tree      
Reading state information... Done
E: Unable to locate package libsd12-dev
E: Unable to locate package libsd12-ttf-dev
amulya@SHAHI:~$

Thanks in advance
Parent - - By RunnerPack Date 2015-07-15 01:15
In case you haven't noticed yet, it's actually " libsdl2" not " libsd12" (i.e. it's a lowercase "L", not a "one").
Parent - By Amulya Shahi Date 2015-07-15 05:05
Hey thanks for correcting that for me..

now its coming up this

amulya@SHAHI:~$ sudo apt-get install build-essential libsdl2-dev libsdl2-ttf-dev libpango1.0-dev libgl1-mesa-dev libfreeimage-dev libopenal-dev libsndfile-dev libiconv-hook-dev libxml2-dev freeglut3 freeglut3-dev ImageMagick libmagickwand-dev
Reading package lists... Done
Building dependency tree      
Reading state information... Done
Note, selecting 'libsndfile1-dev' instead of 'libsndfile-dev'
build-essential is already the newest version.
imagemagick is already the newest version.
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
libcogl15 : Depends: libegl1-mesa-drivers
libmagickwand-dev : Depends: libmagickcore-dev (= 8:6.7.7.10-6ubuntu3) but it is not going to be installed
libpango1.0-dev : Depends: libpango-1.0-0 (= 1.36.3-1ubuntu1) but 1.36.3-1ubuntu1.1 is to be installed
                   Depends: libpangocairo-1.0-0 (= 1.36.3-1ubuntu1) but 1.36.3-1ubuntu1.1 is to be installed
                   Depends: libpangoft2-1.0-0 (= 1.36.3-1ubuntu1) but 1.36.3-1ubuntu1.1 is to be installed
                   Depends: libpangoxft-1.0-0 (= 1.36.3-1ubuntu1) but 1.36.3-1ubuntu1.1 is to be installed
                   Depends: gir1.2-pango-1.0 (= 1.36.3-1ubuntu1) but 1.36.3-1ubuntu1.1 is to be installed
                   Depends: libglib2.0-dev (>= 2.34.0) but it is not going to be installed
                   Depends: libxft-dev but it is not going to be installed
                   Depends: libfontconfig1-dev (>= 2.10.91) but it is not going to be installed
                   Depends: libharfbuzz-dev (>= 0.9.9) but it is not going to be installed
                   Depends: libcairo2-dev (>= 1.12.10) but it is not going to be installed
                   Recommends: debhelper but it is not going to be installed
libsdl2-dev : Depends: libegl1-mesa-dev
               Depends: libgles2-mesa-dev
               Depends: libpulse-dev but it is not going to be installed
               Depends: libudev-dev but it is not going to be installed
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.
amulya@SHAHI:~$

Thanks ..
Parent - By Amulya Shahi Date 2015-07-15 06:50
Thanks boss..

I did it on another ubuntu window..
Parent - By Amulya Shahi Date 2015-07-14 06:15
ooh... Thanks..
Parent - By Amulya Shahi Date 2015-07-15 06:48
Thank you..!!


I managed to install gosu on another OS..


Looks like there was some package issue on the OS, I was trying to install gosu..

Thankss...;)
Parent - - By dorje Date 2015-07-27 10:01
help me
trying install gosu on ubuntu 14.10
error occur while installing pakages..

the following packages have unmet dependencies:
libgl1-mesa-dev : Depends: mesa-common-dev (= 10.3.2-0ubuntu0.1) but it is not going to be installed
                   Depends: libgl1-mesa-glx (= 10.3.2-0ubuntu0.1) but 10.6~git1504161930.94aab6~gd~u is to be installed
                   Depends: libdrm-dev (>= 2.4.52) but it is not going to be installed
libsdl2-dev : Depends: libegl1-mesa-dev but it is not going to be installed
               Depends: libgles2-mesa-dev but it is not going to be installed
libsndfile1-dev : Depends: libvorbis-dev (>= 1.2.3) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
Parent - By jlnr (dev) Date 2015-07-27 10:16
Sorry, but that doesn't look like a Gosu-related issue. I have never seen these messages on a fresh installation of Ubuntu 14.10, so something must have gone wrong before you even started installing Gosu's dependencies.
Parent - By cnr Date 2016-03-03 08:20 Edited 2016-03-03 09:07
On Ubuntu 14.04, RVM and Ruby 2.3.0 you should also add libgmp-dev package to the sudo apt-get install... list.

Instead you'll keep getting Failed to build gem native extension while trying to install gosu, faster_xml_simple and other gems. In extension build log there will be error:
...
/usr/bin/ld: cannot find -lgmp
collect2: error: ld returned 1 exit status
...
Up Topic Gosu / Gosu Exchange / Ubuntu 14.04 quick start

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill