Page 1 of 1

Rubygame Install on OSX - rsdl error

PostPosted: Fri Jun 18, 2010 7:49 am
by indspenceable
Hi,

I'm running OSX 10.6.3 and I can't, for the life of me, get rubygame to install. Well - actually I think rubygame works fine, but whenever I try to use rsdl I get the following error.

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:827:in `report_activate_error': Could not find RubyGem rsdl (>= 0) (Gem::LoadError)
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:261:in `activate'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:68:in `gem'
from /usr/bin/rsdl:18

Can anyone point me in the right direction? I've tried everything I can think of. I don't know what other information I should be providing, but if theres something else you need to see I can post that, just let me know.

Thanks!

Re: Rubygame Install on OSX - rsdl error

PostPosted: Sat Jun 19, 2010 8:33 am
by jacius
Hello, and welcome :)

Can you tell me more about how you have installed Rubygame, etc.?

Did you use the Rubygame Mac Pack, or follow the instructions on the Mac Installation Guide? Or install things yourself some other way?

What version of Ruby do you have (run the command "ruby --version")? What version of Rubygems ("gem --version")? Was rsdl installed from a gem?

Re: Rubygame Install on OSX - rsdl error

PostPosted: Mon Aug 23, 2010 9:33 pm
by indspenceable
Hi,

Sorry for the lack of response - I got it working before I saw this. I had tried installing rubygame from a number of sources; and I didn't have a successful install of RSDL. I got it working somehow (using the arch flag for compiling, I believe). I'm trying to help a friend out in his installation, but he's running into a similar problem. Rather, he can get some form or RSDL onto his computer, but whenever he tries to use it, he gets this error:
Code: Select all
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:827:in `report_activate_error': RubyGem version error: rake(0.8.3 not >= 0.8.7) (Gem::LoadError)

When he tries to install RSDL (either as a gem, or independently) this is what he gets:
Code: Select all
gcc rsdl.o -L. -L/usr/local/lib  -L.   -lruby -lpthread -ldl -lobjc  -L/opt/local/lib -lSDLmain -lSDL -Wl,-framework,Cocoa -o rsdl
ld: warning: in /usr/local/lib/libSDL.dylib, file was built for i386 which is not the architecture being linked (x86_64)
Undefined symbols:
  "_SDL_PushEvent", referenced from:
      -[NSApplication(SDLApplication) terminate:] in libSDLmain.a(SDLMain.o)
ld: symbol(s) not found
collect2: ld returned 1 exit status
make: *** [rsdl] Error 1

(There is a full stacktrace, as well, which I could post, but its all within rubygems.rb)

I think he started by installing it with the mac pack but after that didnt work he did the mac installation guide; installed SDL w/ libraries through macports. Ruby is mac system ruby. He's running OSX 10.6.4.

Re: Rubygame Install on OSX - rsdl error

PostPosted: Tue Aug 24, 2010 5:17 am
by jacius
indspenceable wrote:I'm trying to help a friend out in his installation, but he's running into a similar problem. Rather, he can get some form or RSDL onto his computer, but whenever he tries to use it, he gets this error:
Code: Select all
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:827:in `report_activate_error': RubyGem version error: rake(0.8.3 not >= 0.8.7) (Gem::LoadError)

This looks like the version of Rake that comes with the system Ruby is too old. You should be able to update it with "sudo gem update rake".

indspenceable wrote:When he tries to install RSDL (either as a gem, or independently) this is what he gets:
Code: Select all
gcc rsdl.o -L. -L/usr/local/lib  -L.   -lruby -lpthread -ldl -lobjc  -L/opt/local/lib -lSDLmain -lSDL -Wl,-framework,Cocoa -o rsdl
ld: warning: in /usr/local/lib/libSDL.dylib, file was built for i386 which is not the architecture being linked (x86_64)
Undefined symbols:
  "_SDL_PushEvent", referenced from:
      -[NSApplication(SDLApplication) terminate:] in libSDLmain.a(SDLMain.o)
ld: symbol(s) not found
collect2: ld returned 1 exit status
make: *** [rsdl] Error 1

(There is a full stacktrace, as well, which I could post, but its all within rubygems.rb)

I think he started by installing it with the mac pack but after that didnt work he did the mac installation guide; installed SDL w/ libraries through macports. Ruby is mac system ruby. He's running OSX 10.6.4.

This is due to the version of SDL in the Mac Pack being compiled for (32-bit) Intel Macs, but your friend seems to be using a 64-bit Mac. One thing to try would be to add "-arch i386" to the CFLAGS in rsdl's Makefile, then do a clean build ("make clean && make").

If that doesn't work, it may be necessary to compile SDL for 64-bit. :|

Re: Rubygame Install on OSX - rsdl error

PostPosted: Tue Aug 24, 2010 6:52 pm
by indspenceable
Hi! Thanks so much for the help.

Unfortunately the problem isn't fixed; so it looks like we'll have to try rebuilding SDL. Before we do so, though, I wanted to ask - since my friend is on 64-bit OSX, shouldn't macports have built a 64 bit version?

Re: Rubygame Install on OSX - rsdl error

PostPosted: Tue Aug 24, 2010 11:23 pm
by jacius
indspenceable wrote:Unfortunately the problem isn't fixed; so it looks like we'll have to try rebuilding SDL. Before we do so, though, I wanted to ask - since my friend is on 64-bit OSX, shouldn't macports have built a 64 bit version?

Ah, yes, it should have. And I'm guessing it did, but the compiler is finding the libraries from the Mac Pack instead. Try removing /usr/local/lib/libSDL.dylib etc. I think Macports puts its files in /opt/local/lib, so you may need to add "-L/opt/local/lib" to your LDFLAGS in the Makefile.

Re: Rubygame Install on OSX - rsdl error

PostPosted: Wed Aug 25, 2010 2:04 am
by indspenceable
Wonderful! Its working, thanks so much.

Re: Rubygame Install on OSX - rsdl error

PostPosted: Fri Dec 17, 2010 11:40 pm
by click170
Hi
I think I'm having a similar problem, can you post what you did specifically to get your setup working?

I installed the Rubygame Mac Pack, and am calling my script by `rsdl sample1.rb` and have removed the shebang from sample1.rb but I'm still getting a bus error.
Any ideas? Thanks :)

Re: Rubygame Install on OSX - rsdl error

PostPosted: Thu Jul 21, 2011 5:35 pm
by Jwosty
I, too, am on a Mac (osx 1.6.8), and am getting a similar error. I tried to use the mac pack for installation at first, but after that failed I tried the other installation steps. I guess the mac pack just does not work xP

Error code:

Code: Select all
Building native extensions.  This could take a while...
ERROR:  Error installing rsdl:
   ERROR: Failed to build gem native extension.

        /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
checking for ruby_sysinit()... no
checking for ruby_run_node()... no
creating Makefile
creating rsdl.c

make
gcc -arch i386 -arch x86_64 -g -Os -pipe -fno-common -DENABLE_DTRACE  -fno-common  -pipe -fno-common   -I"/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin10.0" -I/opt/local/include/SDL -D_GNU_SOURCE=1 -D_THREAD_SAFE -c rsdl.c
gcc rsdl.o -L. -L/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib  -L. -arch i386 -arch x86_64   -lruby -lpthread -ldl  -L/opt/local/lib -lSDLmain -lSDL -Wl,-framework,Cocoa -o rsdl
ld: warning: in /opt/local/lib/libSDLmain.a, file is not of required architecture
ld: warning: in /opt/local/lib/libSDL.dylib, file is not of required architecture
Undefined symbols for architecture i386:
  "_main", referenced from:
      start in crt1.10.6.o
ld: symbol(s) not found for architecture i386
collect2: ld returned 1 exit status
lipo: can't open input file: /var/tmp//cccEda4y.out (No such file or directory)
make: *** [rsdl] Error 1


Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/rsdl-0.1.4 for inspection.
Results logged to /Library/Ruby/Gems/1.8/gems/rsdl-0.1.4/./gem_make.out


Maybe I'll just have to stick with Gosu...