Forums Archived

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

Load error on Mac OS X

Get help and support with Rubygame

Load error on Mac OS X

Postby cgmjr » Tue Sep 21, 2010 11:40 pm

Hello again Rubygamers. I'm back, with a Mac! I've installed rubygame with the Mac Pack, but my Mac n00bness is high, so I can't troubleshoot this loaderror. Starting up irb, and giving it a simple
Code: Select all
require 'rubygame'

I get:

Code: Select all
~/desktop/sandbox: irb
>> require 'rubygame'
LoadError: dlopen(/Library/Ruby/Gems/1.8/gems/ffi-0.5.1-x86-darwin-9/lib/ffi_c.bundle, 9): no suitable image found.  Did find:
   /Library/Ruby/Gems/1.8/gems/ffi-0.5.1-x86-darwin-9/lib/ffi_c.bundle: mach-o, but wrong architecture - /Library/Ruby/Gems/1.8/gems/ffi-0.5.1-x86-darwin-9/lib/ffi_c.bundle
   from /Library/Ruby/Gems/1.8/gems/ffi-0.5.1-x86-darwin-9/lib/ffi_c.bundle
   from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `require'
   from /Library/Ruby/Gems/1.8/gems/ffi-0.5.1-x86-darwin-9/lib/ffi.rb:8
   from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
   from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `require'
   from /Library/Ruby/Gems/1.8/gems/nice-ffi-0.4/lib/nice-ffi.rb:31
   from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
   from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `require'
   from /Users/CharlesGary/.gem/ruby/1.8/gems/ruby-sdl-ffi-0.3/lib/ruby-sdl-ffi/sdl.rb:31
   from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
   from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `require'
   from /Library/Ruby/Gems/1.8/gems/rubygame-2.6.4/lib/rubygame/main.rb:22
   from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
   from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `require'
   from /Library/Ruby/Gems/1.8/gems/rubygame-2.6.4/lib/rubygame.rb:44
   from /Library/Ruby/Gems/1.8/gems/rubygame-2.6.4/lib/rubygame.rb:29:in `each'
   from /Library/Ruby/Gems/1.8/gems/rubygame-2.6.4/lib/rubygame.rb:29
   from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
   from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:36:in `require'
   from (irb):1>>


I am especially curious about that "wrong architecture" bit... any help?
User avatar
cgmjr
 
Posts: 39
Joined: Mon Jan 11, 2010 6:41 am

Re: Load error on Mac OS X

Postby blue-wiz » Wed Sep 22, 2010 3:21 pm

The only thing I can think of is that ffi is compiled for 32-bit and the latest macs are 64-bit. Or, if it is an old mac, you may be running power pc. Maybe you should try to reinstall ffi or compile it yourself.

I don't have a mac, but it's worth a try :)
blue-wiz
 
Posts: 12
Joined: Mon Jun 28, 2010 4:27 pm

Re: Load error on Mac OS X

Postby cgmjr » Wed Sep 22, 2010 9:46 pm

blue-wiz wrote:The only thing I can think of is that ffi is compiled for 32-bit and the latest macs are 64-bit. Or, if it is an old mac, you may be running power pc. Maybe you should try to reinstall ffi or compile it yourself.

I don't have a mac, but it's worth a try :)


Hmmm...that's a good theory. I'm not adept at compiling source on the Mac, but it's worth a try.

*listens for jacius for a bit longer*
User avatar
cgmjr
 
Posts: 39
Joined: Mon Jan 11, 2010 6:41 am

Re: Load error on Mac OS X

Postby cgmjr » Wed Sep 29, 2010 12:37 am

Update: I did a "gem update ffi" and that seemed to fix my odd architecture error. Now I'm getting a familiar old problem:
Code: Select all

~/desktop/sandbox: irb
>> require "rubygame"
LoadError: Could not load SDL.
   from /Library/Ruby/Gems/1.8/gems/nice-ffi-0.4/lib/nice-ffi/library.rb:98:in `load_library'
   from /Users/CharlesGary/.gem/ruby/1.8/gems/ruby-sdl-ffi-0.3/lib/ruby-sdl-ffi/sdl.rb:51
   from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
   from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `require'
   from /Library/Ruby/Gems/1.8/gems/rubygame-2.6.4/lib/rubygame/main.rb:22
   from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
   from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `require'
   from /Library/Ruby/Gems/1.8/gems/rubygame-2.6.4/lib/rubygame.rb:44
   from /Library/Ruby/Gems/1.8/gems/rubygame-2.6.4/lib/rubygame.rb:29:in `each'
   from /Library/Ruby/Gems/1.8/gems/rubygame-2.6.4/lib/rubygame.rb:29
   from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
   from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:36:in `require'
   from (irb):1
>>


I seem to recall that RubyGame dynamically builds search paths for the SDL stuff. Maybe that's why we have to use "rsdl" instead of "ruby" as the interpreter? Well, I still get this when I try to invoke a simple script that does a require for rubygame:

Code: Select all
~/desktop/sandbox: ruby tryit.rb
tryit.rb:1:in `require': no such file to load -- rubygame (LoadError)
   from tryit.rb:1
~/desktop/sandbox: rsdl tryit.rb
tryit.rb:1:in `require': no such file to load -- rubygame (LoadError)
   from tryit.rb:1


So, kinda stuck again. Ideas?
User avatar
cgmjr
 
Posts: 39
Joined: Mon Jan 11, 2010 6:41 am

Re: Load error on Mac OS X

Postby shawn42 » Sat Oct 02, 2010 6:00 pm

The only reason it would say "could not find rubygame" is if you haven't required rubygems first. Or you don't have that gem installed... look through the results of "gem list"

HTH
User avatar
shawn42
 
Posts: 109
Joined: Tue Feb 10, 2009 8:22 pm

Re: Load error on Mac OS X

Postby cgmjr » Wed Oct 06, 2010 3:56 pm

shawn42 wrote:The only reason it would say "could not find rubygame" is if you haven't required rubygems first. Or you don't have that gem installed... look through the results of "gem list"

HTH

I'm good on Rubygems (1.3.7). But, ya know, I think I got a warning during install of the Mac Pac about a path issue, but I blew it off. So, hmm. I wonder:

I've located libSDL_*.dylib stuff in /usr/local/lib, but my PATH does not include /usr/local/lib. Is that required, or does Rubygame figure that out?
User avatar
cgmjr
 
Posts: 39
Joined: Mon Jan 11, 2010 6:41 am

Re: Load error on Mac OS X

Postby shawn42 » Thu Oct 07, 2010 3:04 am

You can probably ignore that warning; as long as the dylibs are in /usr/local/lib, rubygame knows where to look for them (it's part of jacius' nice-ffi library). That being said, are you still getting an error about not being able to load rubygame? Can you paste the error here?
User avatar
shawn42
 
Posts: 109
Joined: Tue Feb 10, 2009 8:22 pm

Re: Load error on Mac OS X

Postby cgmjr » Thu Oct 07, 2010 3:39 pm

shawn42 wrote:You can probably ignore that warning; as long as the dylibs are in /usr/local/lib, rubygame knows where to look for them (it's part of jacius' nice-ffi library). That being said, are you still getting an error about not being able to load rubygame? Can you paste the error here?


I do get that error if I do not explicitly require "rubygems" first (I don't recall having to do that on the Windows side), but when I add that, I still can't load SDL. I get:

Code: Select all
LoadError: Could not load SDL.

method load_library   in library.rb at line 98
at top level   in sdl.rb at line 51
method gem_original_require   in custom_require.rb at line 31
method require   in custom_require.rb at line 31
at top level   in main.rb at line 22
method gem_original_require   in custom_require.rb at line 31
method require   in custom_require.rb at line 31
at top level   in rubygame.rb at line 44
method each   in rubygame.rb at line 29
at top level   in rubygame.rb at line 29
method gem_original_require   in custom_require.rb at line 36
method require   in custom_require.rb at line 36
at top level   in tryit.rb at line 2


And my /usr/local/lib has:

Code: Select all

~/desktop/sandbox: ls /usr/local/lib
libFLAC.8.0.1.dylib      libmikmod.2.0.4.dylib
libFLAC.8.2.0.dylib      libmikmod.2.dylib
libFLAC.8.dylib         libmikmod.dylib
libFLAC.dylib         libogg.0.5.3.dylib
libSDL-1.2.0.dylib      libogg.0.dylib
libSDL.dylib         libogg.dylib
libSDL_gfx.13.dylib      libsmpeg-0.4.0.dylib
libSDL_gfx.dylib      libsmpeg.dylib
libSDL_image-1.2.0.dylib   libvorbis.0.3.0.dylib
libSDL_image.dylib      libvorbis.0.dylib
libSDL_mixer-1.2.0.dylib   libvorbis.dylib
libSDL_mixer.dylib      libvorbisfile.3.1.0.dylib
libSDL_ttf-2.0.0.6.3.dylib   libvorbisfile.3.dylib
libSDL_ttf-2.0.0.dylib      libvorbisfile.dylib
libSDL_ttf.dylib      perl5
libfreetype.6.dylib      python2.6
libfreetype.dylib
~/desktop/sandbox:


And my gem list is:
Code: Select all

~/desktop/sandbox: gem list

*** LOCAL GEMS ***

actionmailer (2.3.5, 1.3.6)
actionpack (2.3.5, 1.13.6)
actionwebservice (1.2.6)
activerecord (2.3.5, 1.15.6)
activeresource (2.3.5)
activesupport (2.3.5, 1.4.4)
acts_as_ferret (0.4.3)
capistrano (2.5.2)
cgi_multipart_eof_fix (2.5.0)
cheat (1.3.0)
columnize (0.3.1)
daemons (1.0.10)
dnssd (0.6.0)
fastthread (1.0.1)
fcgi (0.8.7)
ferret (0.11.6)
ffi (0.5.1 x86-darwin-9)
gem_plugin (0.2.3)
highline (1.5.0)
hpricot (0.6.164)
libxml-ruby (1.1.2)
linecache (0.43)
mongrel (1.1.5)
needle (1.3.0)
net-scp (1.0.1)
net-sftp (2.0.1, 1.1.1)
net-ssh (2.0.4, 1.1.4)
net-ssh-gateway (1.0.0)
nice-ffi (0.4)
rack (1.0.1)
rails (2.3.5, 1.2.6)
rake (0.8.7, 0.8.3)
RedCloth (4.1.1)
ruby-debug (0.10.3)
ruby-debug-base (0.10.3)
ruby-openid (2.1.2)
ruby-sdl-ffi (0.3)
ruby-yadis (0.3.4)
rubygame (2.6.4)
rubygems-update (1.3.7)
rubynode (0.1.5)
sqlite3-ruby (1.2.4)
termios (0.9.4)
xmpp4r (0.4)
~/desktop/sandbox:


/puzzled.
User avatar
cgmjr
 
Posts: 39
Joined: Mon Jan 11, 2010 6:41 am

Re: Load error on Mac OS X

Postby shawn42 » Thu Oct 07, 2010 7:50 pm

Thanks for posting that info, I'm getting a little puzzled myself.

Can you set SDL_PATHS = ['path to sdl']

see if that helps..

Otherwise.. wait for a comment from jacius on this one... :?
User avatar
shawn42
 
Posts: 109
Joined: Tue Feb 10, 2009 8:22 pm

Re: Load error on Mac OS X

Postby cgmjr » Thu Oct 07, 2010 8:44 pm

shawn42 wrote:Thanks for posting that info, I'm getting a little puzzled myself.

Can you set SDL_PATHS = ['path to sdl']

see if that helps..

Otherwise.. wait for a comment from jacius on this one... :?


Ok, I think I found my problem: I was invoking my little test script with "ruby" not "rsdl." It works with "rsdl" as long as I explicitly require 'rubygems'.

Having gotten past that, I have an even uglier error, for which I will start a different thread.

*wave*
User avatar
cgmjr
 
Posts: 39
Joined: Mon Jan 11, 2010 6:41 am

Next

Return to Help & Support

Who is online

Users browsing this forum: No registered users and 2 guests

cron