Forums Archived

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

Deployment using Ocra.

Get help and support with Rubygame

Deployment using Ocra.

Postby roguelikedev » Thu Jul 07, 2011 7:26 am

I've done a lot of screaming in the last few hours, so I'll keep this short.

game.rb:
Code: Select all
#!/usr/bin/env ruby
require 'rubygame'


From MINGW32 console:

$ ocra game.rb
=== Loading script to check dependencies
Warning: Function 'arcColor' not found in [C:/windows/system32/SDL_gfx.dll]
Warning: Function 'arcRGBA' not found in [C:/windows/system32/SDL_gfx.dll]
Warning: Function 'filledPolygonColorMT' not found in [C:/windows/system32/SDL_gfx.dll]
Warning: Function 'filledPolygonRGBAMT' not found in [C:/windows/system32/SDL_gfx.dll]
Warning: Function 'texturedPolygonMT' not found in [C:/windows/system32/SDL_gfx.dll]
Warning: Function 'rotateSurface90Degrees' not found in [C:/windows/system32/SDL_gfx.dll]
=== Detected gem ffi-1.0.9-x86-mingw32 (loaded, files)
=== 45 files, 472914 bytes
=== Detected gem nice-ffi-0.4 (loaded, files)
=== 9 files, 61014 bytes
=== Detected gem ruby-sdl-ffi-0.4 (loaded, files)
=== 24 files, 113885 bytes
=== Detected gem rubygame-2.6.4 (loaded, files)
=== 55 files, 1087341 bytes
=== Including 52 encoding support files (2741248 bytes, use --no-enc to exclude)
=== Building game.exe
=== Adding user-supplied source files
=== Adding ruby executable ruby.exe
=== Adding detected DLL c:/Ruby192/bin/zlib1.dll
=== Adding library files
=== Compressing 8312492 bytes
=== Finished building game.exe (1994355 bytes)


I'm not concerned about the warnings. I know where they come from. This is what I am concerned about:

$ game.exe
C:/DOCUME~1/SNEAK~1/LOCALS~1/Temp/ocr497.tmp/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs': Could not find rake (>= 0.7.0) amongst [ffi-1.0.9-x86-mingw32, nice-ffi-0.4, ocra-1.3.0, ruby-sdl-ffi-0.4, rubygame-2.6.4] (Gem::LoadError)
from C:/DOCUME~1/SNEAK~1/LOCALS~1/Temp/ocr497.tmp/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:759:in `block in activate_dependencies'
from C:/DOCUME~1/SNEAK~1/LOCALS~1/Temp/ocr497.tmp/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:756:in `each'
from C:/DOCUME~1/SNEAK~1/LOCALS~1/Temp/ocr497.tmp/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:756:in `activate_dependencies'
from C:/DOCUME~1/SNEAK~1/LOCALS~1/Temp/ocr497.tmp/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:741:in `activate'
from C:/DOCUME~1/SNEAK~1/LOCALS~1/Temp/ocr497.tmp/lib/ruby/site_ruby/1.9.1/rubygems.rb:211:in `rescue in try_activate'
from C:/DOCUME~1/SNEAK~1/LOCALS~1/Temp/ocr497.tmp/lib/ruby/site_ruby/1.9.1/rubygems.rb:208:in `try_activate'
from <internal:gem_prelude>:218:in `try_activate'
from <internal:lib/rubygems/custom_require>:32:in `rescue in require'
from <internal:lib/rubygems/custom_require>:29:in `require'
from C:/DOCUME~1/SNEAK~1/LOCALS~1/Temp/ocr497.tmp/src/map.rb:3:in `<main>'


$ rake --version
rake, version 0.9.2


I have of course tried requiring rake, although I'm not sure what rubygame needs it for in the first place; no dice. Any suggestions?
roguelikedev
 
Posts: 3
Joined: Thu Jul 07, 2011 6:52 am

Re: Deployment using Ocra.

Postby roguelikedev » Fri Jul 08, 2011 5:36 pm

Solved it by explicitly requiring a version number.

gem 'rake', '>=0.7.0'
require 'rake'

I stumbled into this 100% via "try everything, no matter how stupid" method and have no idea why it worked, particularly because I didn't have a version of rake lower than 0.7.0 installed.
roguelikedev
 
Posts: 3
Joined: Thu Jul 07, 2011 6:52 am

Re: Deployment using Ocra.

Postby jacius » Fri Jul 08, 2011 10:07 pm

roguelikedev wrote:I have of course tried requiring rake, although I'm not sure what rubygame needs it for in the first place; no dice. Any suggestions?

I'm pretty sure the dependency on Rake is left over from the old days when Rubygame was a compiled extension. It's probably not needed anymore, although I have not yet personally tested installing the gem without it.

If you're feeling adventurous, you could download the Rubygame 2.6.4 source, and edit the Rakefile to remove this line of code:

Code: Select all
  s.add_dependency( "rake", ">=0.7.0" )

Then run "gem uninstall rubygame" to remove the old gem, "rake gem" to build the new gem, and "gem install pkg/rubygame-2.6.4.gem" to install the new gem. I think you should then be able to build an OCRA binary without a dependency on Rake.
User avatar
jacius
Site Admin
 
Posts: 131
Joined: Fri Feb 06, 2009 11:13 pm

Re: Deployment using Ocra.

Postby roguelikedev » Mon Jul 11, 2011 9:05 pm

I'll pass, thanks.
roguelikedev
 
Posts: 3
Joined: Thu Jul 07, 2011 6:52 am


Return to Help & Support

Who is online

Users browsing this forum: No registered users and 0 guests

cron