Forums Archived

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

Installing Rubygame 2.4.1 in Windows

Get help and support with Rubygame

Installing Rubygame 2.4.1 in Windows

Postby bmatthew1 » Wed Apr 01, 2009 3:24 pm

Is it possible? :lol:

I'm currently using Windows XP with Ruby version 1.8.6 & Rubygame 2.3.0.

I noticed that version 2.4.1 of Rubygame had came out so I tried installing it using Rubygems but got the following errors.

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

rake RUBYARCHDIR=c:/ruby/lib/ruby/gems/1.8/gems/rubygame-2.4.1/lib RUBYLIBDIR=c:/ruby/lib/ruby/gems/1.8/gems/rubygame-2.4.1/lib
rake aborted!
No such file or directory - cl -nologo -c -MD -Zi -O2b2xg- -G6  -I. -Ic:/ruby/lib/ruby/1.8/i386-mswin32  -DRUBYGAME_MAJOR_VERSION=2 -DRUBYGAME_MINOR_VERSION=4 -DRUBYGAME_PATCHLEVEL=1 -DHAVE_OPENGL   ext/rubygame/rubygame_main.c -o ext/rubygame/rubygame_main.obj
c:/ruby/lib/ruby/gems/1.8/gems/rubygame-2.4.1/rakefile:66:in ``'
(See full trace by running task with --trace)
(in c:/ruby/lib/ruby/gems/1.8/gems/rubygame-2.4.1)
Compiling rubygame/rubygame_main.c


Gem files will remain installed in c:/ruby/lib/ruby/gems/1.8/gems/rubygame-2.4.1 for inspection.
Results logged to c:/ruby/lib/ruby/gems/1.8/gems/rubygame-2.4.1/gem_make.out


I've also tried downloading the source from here. I've got GCC version 3.4.5 & all the relevant SDL dependencies installed but I still get similar errors. Should I just wait for a Win32 version of 2.4.1 to be released?
User avatar
bmatthew1
 
Posts: 28
Joined: Wed Apr 01, 2009 2:20 pm
Location: England

Re: Installing Rubygame 2.4.1 in Windows

Postby shawn42 » Wed Apr 01, 2009 7:34 pm

I haven't installed rubygame for windows. I would suggest that you rerun w/ the --trace option and post that, as well as asking in #rubygame on freenode (IRC). Hope this helps a little.
User avatar
shawn42
 
Posts: 109
Joined: Tue Feb 10, 2009 8:22 pm

Re: Installing Rubygame 2.4.1 in Windows

Postby bmatthew1 » Wed Apr 01, 2009 8:47 pm

Ok, well here's what I got running with --trace.

Code: Select all
(in C:/Documents and Settings/User/Desktop/rubygame-2.4.1)
** Invoke build (first_time)
** Invoke ext/rubygame/rubygame_core.so (first_time)
** Invoke ext/rubygame/rubygame_main.obj (first_time)
** Invoke ext/rubygame/rubygame_main.c (first_time, not_needed)
** Execute ext/rubygame/rubygame_main.obj
Compiling rubygame/rubygame_main.c
rake aborted!
No such file or directory - cl -nologo -c -MD -Zi -O2b2xg- -G6  -I. -Ic:/ruby/lib/ruby/1.8/i386-mswin32  -DRUBYGAME_MAJOR_VERSION=2 -DRUBYGAME_MINOR_VERSION=4 -DRUBYGAME_PATCHLEVEL=1 -DHAVE_OPENGL   ext/rubygame/rubygame_main.c -o ext/rubygame/rubygame_main.obj
C:/Documents and Settings/User/Desktop/rubygame-2.4.1/rakefile:66:in ``'
C:/Documents and Settings/User/Desktop/rubygame-2.4.1/rakefile:66:in `try_shell'
C:/Documents and Settings/User/Desktop/rubygame-2.4.1/rakefile:339:in `create_obj_task'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:615:in `call'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:615:in `execute'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:612:in `each'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:612:in `execute'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:578:in `invoke_with_call_chain'
c:/ruby/lib/ruby/1.8/monitor.rb:242:in `synchronize'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:571:in `invoke_with_call_chain'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:588:in `invoke_prerequisites'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:585:in `each'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:585:in `invoke_prerequisites'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:577:in `invoke_with_call_chain'
c:/ruby/lib/ruby/1.8/monitor.rb:242:in `synchronize'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:571:in `invoke_with_call_chain'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:588:in `invoke_prerequisites'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:585:in `each'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:585:in `invoke_prerequisites'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:577:in `invoke_with_call_chain'
c:/ruby/lib/ruby/1.8/monitor.rb:242:in `synchronize'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:571:in `invoke_with_call_chain'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:564:in `invoke'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:2027:in `invoke_task'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:2005:in `top_level'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:2005:in `each'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:2005:in `top_level'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:2044:in `standard_exception_handling'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:1999:in `top_level'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:1977:in `run'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:2044:in `standard_exception_handling'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:1974:in `run'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/bin/rake:31
c:/ruby/bin/rake:19:in `load'
c:/ruby/bin/rake:19
User avatar
bmatthew1
 
Posts: 28
Joined: Wed Apr 01, 2009 2:20 pm
Location: England

Re: Installing Rubygame 2.4.1 in Windows

Postby bmatthew1 » Wed Apr 01, 2009 10:18 pm

I've just re-read the instructions in windows_install.rdoc & I think I've figured out what I was doing wrong. :oops:
User avatar
bmatthew1
 
Posts: 28
Joined: Wed Apr 01, 2009 2:20 pm
Location: England

Re: Installing Rubygame 2.4.1 in Windows

Postby shawn42 » Thu Apr 02, 2009 2:35 pm

That's great. I was going to say that it didn't look like your compiler was setup correctly.
Can you post what the problem was so future rubygamers will know?
User avatar
shawn42
 
Posts: 109
Joined: Tue Feb 10, 2009 8:22 pm

Re: Installing Rubygame 2.4.1 in Windows

Postby bmatthew1 » Thu Apr 02, 2009 8:39 pm

I'd love to post up a solution but it may be a bit difficult. :)

I tried to build & install rubygame 2.4.1 from source using the envsetup.bat & installing with rake.

I was able to compile the files correctly but I had a terrible time linking them & kept receiving undefined reference errors. (It reminded me of when I first started using C++)

So I decided to create a Code::Blocks project & try & build the rubygame.dll plus the SDL_GFX.dll. I appear to have been successful building them but I don't exactly know what to do now.

I've tried testing the samples but I keep on getting an error like the following...
Code: Select all
C:\ruby\lib\ruby\1.8\rubygame\samples>ruby chimp.rb
./rubygame.dll: 127: The specified procedure could not be found.   - Init_rubygame (LoadError)
./rubygame.dll  from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
        from chimp.rb:26

I don't know whether I'm getting those errors because the rubygame.dll I built is faulty or because I haven't been able to install rubygame as a gem.
User avatar
bmatthew1
 
Posts: 28
Joined: Wed Apr 01, 2009 2:20 pm
Location: England

Re: Installing Rubygame 2.4.1 in Windows

Postby bmatthew1 » Thu Apr 09, 2009 2:03 pm

Could someone please take a look at this librubygame.def file that gets created whenever I build the rubygame .dll & see if there is anything missing?
User avatar
bmatthew1
 
Posts: 28
Joined: Wed Apr 01, 2009 2:20 pm
Location: England

Re: Installing Rubygame 2.4.1 in Windows

Postby bmatthew1 » Mon Apr 20, 2009 5:52 am

Ok, I've created the rubygame.dll, it compiled fine & I got the linking problems sorted out.

I've installed it along with the rubygame.rb file & the rubygame folder plus it's contents but whenever I try to run any of the examples I receive the following error.

Code: Select all
c:/ruby/lib/ruby/1.8/rubygame/constants.rb:25: uninitialized constant Rubygame::Mouse::MOUSE_LEFT (NameError)


Does anyone have any ideas as to what's causing it? :?
User avatar
bmatthew1
 
Posts: 28
Joined: Wed Apr 01, 2009 2:20 pm
Location: England

Re: Installing Rubygame 2.4.1 in Windows

Postby shawn42 » Mon Apr 20, 2009 3:32 pm

You want: Rubygame::MOUSE_LEFT

I don't see any of the examples in rubygames samples directory having the Mouse module in there. What examples are you working from?

Glad to see you are persevering through. Install really is the biggest hurdle for new rubygamers.
User avatar
shawn42
 
Posts: 109
Joined: Tue Feb 10, 2009 8:22 pm

Re: Installing Rubygame 2.4.1 in Windows

Postby bmatthew1 » Mon Apr 20, 2009 8:42 pm

Thanks for the reply shawn, it's much appreciated. :)

You want: Rubygame::MOUSE_LEFT

Are you sure that's right? In my constants.rb file it starts by declaring a module called Rubygame & then another module called Mouse.

Code: Select all
module Rubygame

   module Mouse
      # Hash to translate mouse button sym to string
      MOUSE2STR = {
         MOUSE_LEFT => "left",
         MOUSE_MIDDLE => "middle",
         MOUSE_RIGHT => "right"
      }
      # And to translate the other way...
      STR2MOUSE = MOUSE2STR.invert()
      # And allow numbers too (1 = left, so on)...
      STR2MOUSE[1] = MOUSE_LEFT
      STR2MOUSE[2] = MOUSE_MIDDLE
      STR2MOUSE[3] = MOUSE_RIGHT
   end # module Mouse


I don't see any of the examples in rubygames samples directory having the Mouse module in there. What examples are you working from?

It happens whenever I try any of the examples in the samples directory, it also happens if I open up a Command-Prompt & type in irb then require 'rubygame'.
User avatar
bmatthew1
 
Posts: 28
Joined: Wed Apr 01, 2009 2:20 pm
Location: England

Next

Return to Help & Support

Who is online

Users browsing this forum: No registered users and 1 guest

cron