Forums Archived

The forums are being archived. See this topic for more information.

Rubygame fails to load on Ubuntu without creating symlinks

Get help and support with Rubygame

Rubygame fails to load on Ubuntu without creating symlinks

Postby james » Thu Feb 18, 2010 3:50 pm

When installing Rubygame on Ubuntu 9.10 it will fail to load SDL or if it does load SDL it will most likely not load the other libraries. This is because ruby-sdl-ffi expects the libraries to be named without the version numbers appended to the end.

This is most likely the same thing that was happening to this other user on Windows 7 as he is getting the same error messages as I was. You can get around it on Linux by doing the following:

Code: Select all
cd /usr/lib
sudo ln -s libSDL-1.2.so.0.11.2 libSDL.so

You can get around it on Windows by renaming the files or creating new ones that follow the naming convention.

The actual version number of your SDL may vary but the concept is the same. You will also need to do the same for all the other libraries as well.

Oddly enough when I first tried to install Rubygame SDL would load but the other libraries would not. I can only assume another game I had installed had created the symlink.

You could just use custom SDL loading paths to get around this but this appears to not work either. It appears to just ignore any of the path names I pass to it. Tested this by copying my libSDL to the libs subdirectory of my game folder and renaming it to "libSDL.so" and then using this example code:

Code: Select all
main_dir = File.dirname(__FILE__)
SDL_PATHS = [ File.join( main_dir, "libs" ) ]
require "rubygame"

You would only notice this fail if there is not a symlink in the /usr/lib directory since load_library falls back on to the standard paths which may explain why no one has noticed.

Is there any way to add this to the installation documentation on the wiki? It might save someone a few hours scratching their heads.
james
 
Posts: 4
Joined: Thu Feb 18, 2010 3:30 pm

Re: Rubygame fails to load on Ubuntu without creating symlinks

Postby james » Thu Feb 18, 2010 4:41 pm

After doing a bit more work on this it appears that ruby-sdl-ffi looks in the following directories by default for SDL:

Code: Select all
/usr/local/lib/libSDL.so*
/usr/local/lib/libSDL-*.so*
/usr/lib/libSDL.so*
/usr/lib/libSDL-*.so*

I'm very new to Regex but given that it does seem to account for version names why would it be unable to match to my SDL library?

Also the example code for loading SDL from a custom directory does works just you need to put a slash on the end.

Code: Select all
SDL_PATHS = [ File.join( main_dir, "libs/" ) ]
james
 
Posts: 4
Joined: Thu Feb 18, 2010 3:30 pm

Re: Rubygame fails to load on Ubuntu without creating symlinks

Postby james » Thu Feb 18, 2010 5:15 pm

Nevermind it appears I have been barking up the wrong tree. It appears I forgot to install the development libraries :oops: Ignore all this!
james
 
Posts: 4
Joined: Thu Feb 18, 2010 3:30 pm

Re: Rubygame fails to load on Ubuntu without creating symlinks

Postby jacius » Fri Feb 19, 2010 12:28 am

james wrote:Also the example code for loading SDL from a custom directory does works just you need to put a slash on the end.

Code: Select all
SDL_PATHS = [ File.join( main_dir, "libs/" ) ]

You are right about the custom path having to end with a slash. That's a bug in Nice-FFI that will be fixed soon.

james wrote:Nevermind it appears I have been barking up the wrong tree. It appears I forgot to install the development libraries :oops: Ignore all this!

You shouldn't need any special development packages, only the .so files (.dylib on Mac, .dll on Windows).

When did you first install Rubygame? (Actually, Nice-FFI, which is used by Ruby-SDL-FFI, which is used by Rubygame.) If you had installed it more than a month ago, then you may have been using Nice-FFI 0.2, which did not work when the .so files had a version on them.
User avatar
jacius
Site Admin
 
Posts: 131
Joined: Fri Feb 06, 2009 11:13 pm

Re: Rubygame fails to load on Ubuntu without creating symlinks

Postby james » Sat Feb 20, 2010 2:24 am

jacius wrote:You shouldn't need any special development packages, only the .so files (.dylib on Mac, .dll on Windows).


For some reason I had to remove my SDL libraries and let apt get them again for it to work. I'm not entirely sure what was the problem in the first place so I am sorry I can not be more specific. I do have several lib folders being a 64bit distro which may have causing issues. The installation instructions on the wiki for Ubuntu look like they do include the SDL development libraries though. Perhaps a throw back to an older version of Rubygame?

jacius wrote:When did you first install Rubygame? (Actually, Nice-FFI, which is used by Ruby-SDL-FFI, which is used by Rubygame.) If you had installed it more than a month ago, then you may have been using Nice-FFI 0.2, which did not work when the .so files had a version on them.


I installed it on Thursday so I assume I have the latest version, without rebooting I can't check for certain. Considering it is fine with the version numbers in the names now I am pretty sure it isn't the old version.
james
 
Posts: 4
Joined: Thu Feb 18, 2010 3:30 pm


Return to Help & Support

Who is online

Users browsing this forum: No registered users and 1 guest

cron