shawn42 / gamebox

A game template for building and distributing Gosu apps.
267 stars 29 forks source link

Can't run nario and roids examples #1

Closed ghost closed 15 years ago

ghost commented 15 years ago

O.S.: gNewSense 2.2 (GNU/Linux) Ruby: 1.8.6

When I try to run nario and roids I get the following error:

Load error: #<LoadError: no such file to load -- chipmunk>
/usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
/usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in `require'
./src/../config/../../../lib/gamebox/physics.rb:1
/usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
/usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in `require'
./src/../config/../../../lib/gamebox/physical_level.rb:5
/usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
/usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in `require'
./src/../config/../src/demo_level.rb:1
/usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
/usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in `require'
./src/../config/../../../lib/gamebox/mode.rb:56:in `build_level'
./src/../config/../../../lib/gamebox/mode.rb:30:in `start'
./src/../config/../../../lib/gamebox/mode_manager.rb:66:in `change_mode_to'
./src/../config/../src/game.rb:9:in `setup'
(eval):10:in `initialize'
./src/../config/../lib/diy.rb:245:in `new'
./src/../config/../lib/diy.rb:245:in `construct_object'
./src/../config/../lib/diy.rb:177:in `[]'
./src/../config/../../../lib/gamebox/gamebox_application.rb:34:in `setup'
./src/../config/../../../lib/gamebox/gamebox_application.rb:62:in `start'
./src/../config/../../../lib/gamebox/gamebox_application.rb:25:in `run'
src/app.rb:7
./src/../config/../../../lib/gamebox/mode.rb:62:in `const_get': Failed to construct 'game' (DIY::ConstructionError)
  ...caused by:
  >>> uninitialized constant ObjectSpace::DemoLevel from ./src/../config/../../../lib/gamebox/mode.rb:62:in `build_level'
    from ./src/../config/../../../lib/gamebox/mode.rb:30:in `start'
    from ./src/../config/../../../lib/gamebox/mode_manager.rb:66:in `change_mode_to'
    from ./src/../config/../src/game.rb:9:in `setup'
    from (eval):10:in `initialize'
    from ./src/../config/../lib/diy.rb:245:in `new'
    from ./src/../config/../lib/diy.rb:245:in `construct_object'
    from ./src/../config/../lib/diy.rb:177:in `[]'
    from ./src/../config/../../../lib/gamebox/gamebox_application.rb:34:in `setup'
    from ./src/../config/../../../lib/gamebox/gamebox_application.rb:62:in `start'
    from ./src/../config/../../../lib/gamebox/gamebox_application.rb:25:in `run'
    from src/app.rb:7

Note that I have Chipmunk 4.1.0 installed and chipmunk demos work ok.

shawn42 commented 15 years ago

After installing the C version of chipmunk did you also install the ruby bindings?

ghost commented 15 years ago

I did the following:

Ruby: I maintain a Ruby extension for Chipmunk. To build it, run
'ruby extconf.rb' then 'make' from inside the ruby directory.

Is extension the same as binding?

ghost commented 15 years ago

I moved chipmunk.so to /usr/lib/ruby/1.8/i486-linux and now roids work but nario doesn't.

./src/../config/../src/nario.rb:22:in `setup': Failed to construct 'game' (DIY::ConstructionError)
  ...caused by:
  >>> undefined method `mass' for #    from ./src/../config/../../../lib/gamebox/actor.rb:31:in `initialize'
    from ./src/../config/../../../lib/gamebox/actor_factory.rb:26:in `new'
    from ./src/../config/../../../lib/gamebox/actor_factory.rb:26:in `build'
    from ./src/../config/../../../lib/gamebox/level.rb:29:in `create_actor'
    from ./src/../config/../../../lib/gamebox/level.rb:56:in `create_actors_from_svg'
    from ./src/../config/../../../lib/gamebox/level.rb:47:in `each'
    from ./src/../config/../../../lib/gamebox/level.rb:47:in `create_actors_from_svg'
    from ./src/../config/../src/demo_level.rb:16:in `setup'
     ... 10 levels...
    from ./src/../config/../../../lib/gamebox/gamebox_application.rb:34:in `setup'
    from ./src/../config/../../../lib/gamebox/gamebox_application.rb:62:in `start'
    from ./src/../config/../../../lib/gamebox/gamebox_application.rb:25:in `run'
    from src/app.rb:7
don-durrance commented 15 years ago

I'm having the same problem with nario, same undefined method 'mass' error. It's a shame, since I'd love to use it as the basis for a project.

shawn42 commented 15 years ago

The mass method is defined in the a trunk build of chipmunk that I was using. You can change the method to be .m instead of .mass and all should be well.

Let me know if that works.