shawn42 / gamebox

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

Newly generated game not running #79

Closed koppen closed 11 years ago

koppen commented 11 years ago

Following the instructions in the README nets me an error

undefined method `setup' for #<StageDefinition:0x00000100ce1160>

The full log of me installing Gamebox as the README prescribes:

$ rvm use 1.9.3@gamebox
Using /Users/jakob/.rvm/gems/ruby-1.9.3-p194 with gemset gamebox

~/Projects/Games 
$ git clone git://github.com/shawn42/gamebox.git
Cloning into 'gamebox'...
remote: Counting objects: 7888, done.
remote: Compressing objects: 100% (2571/2571), done.
remote: Total 7888 (delta 5223), reused 7751 (delta 5086)
Receiving objects: 100% (7888/7888), 12.45 MiB | 461 KiB/s, done.
Resolving deltas: 100% (5223/5223), done.

~/Projects/Games 
$ cd gamebox/
Using /Users/jakob/.rvm/gems/ruby-1.9.3-p194

~/Projects/Games/gamebox (master) 
$ rvm use 1.9.3@gamebox
Using /Users/jakob/.rvm/gems/ruby-1.9.3-p194 with gemset gamebox

~/Projects/Games/gamebox (master) 
$ bundle && rake install
Fetching gem metadata from http://rubygems.org/.......
Fetching gem metadata from http://rubygems.org/..
Installing rake (10.0.3) 
Installing algorithms (0.5.0) with native extensions 
Installing chipmunk (5.3.4.5) with native extensions 
Installing coderay (1.0.8) 
Installing conject (0.1.0) 
Installing diff-lcs (1.1.3) 
Installing gosu (0.7.45) 
Installing i18n (0.6.1) 
Installing publisher (1.1.2) 
Installing kvo (0.0.4) 
Installing listen (0.6.0) 
Installing require_all (1.2.1) 
Using thor (0.16.0) 
Installing tween (0.1.2) 
Using gamebox (0.4.0.rc10) from source at /Users/jakob/Projects/games/gamebox 
Installing metaclass (0.0.1) 
Installing method_source (0.8.1) 
Installing mocha (0.13.1) 
Installing multi_json (1.5.0) 
Installing polaris (1.1.2) 
Installing slop (3.3.3) 
Installing pry (0.9.10) 
Installing pry-remote (0.1.6) 
Installing rspec-core (2.12.2) 
Installing rspec-expectations (2.12.1) 
Installing rspec-mocks (2.12.1) 
Installing rspec (2.12.0) 
Installing simplecov-html (0.7.1) 
Installing simplecov (0.7.1) 
Using bundler (1.1.4) 
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.
gamebox 0.4.0.rc10 built to pkg/gamebox-0.4.0.rc10.gem
gamebox (0.4.0.rc10) installed

~/Projects/Games/gamebox (master) 
$ cd ..

~/Projects/Games 
$ gamebox new zapper
/Users/jakob/.rvm/gems/ruby-1.9.3-p194@gamebox/gems/chipmunk-5.3.4.5/lib/chipmunk.rb:6: Use RbConfig instead of obsolete and deprecated Config.
      create  
      create  .gitignore
      create  Gemfile
      create  README.md
      create  Rakefile
      create  config/boot.rb
      create  config/environment.rb
      create  config/game.yml
      create  data/fonts/FONTS_GO_HERE
      create  data/graphics/GRAPHICS_GO_HERE
      create  data/music/MUSIC_GOES_HERE
      create  data/sounds/SOUND_FX_GO_HERE
      create  spec/helper.rb
      create  src/actors/player.rb
      create  src/app.rb
      create  src/demo_stage.rb

~/Projects/Games 
$ cd zapper/

~/Projects/Games/zapper 
$ bundle
Fetching gem metadata from http://rubygems.org/.........
Fetching gem metadata from http://rubygems.org/..
Using conject (0.1.0) 
Using diff-lcs (1.1.3) 
Using gosu (0.7.45) 
Using i18n (0.6.1) 
Using publisher (1.1.2) 
Using kvo (0.0.4) 
Using listen (0.6.0) 
Using require_all (1.2.1) 
Using thor (0.16.0) 
Using tween (0.1.2) 
Using gamebox (0.4.0.rc10) 
Using rspec-core (2.12.2) 
Using rspec-expectations (2.12.1) 
Using rspec-mocks (2.12.1) 
Using rspec (2.12.0) 
Using bundler (1.1.4) 
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.

~/Projects/Games/zapper 
$ rake
/Users/jakob/.rvm/gems/ruby-1.9.3-p194@gamebox/gems/chipmunk-5.3.4.5/lib/chipmunk.rb:6: Use RbConfig instead of obsolete and deprecated Config.
rake aborted!
undefined method `setup' for #<StageDefinition:0x00000100ce1160>
/Users/jakob/Projects/games/zapper/src/demo_stage.rb:4:in `block in <top (required)>'
/Users/jakob/.rvm/gems/ruby-1.9.3-p194@gamebox/gems/gamebox-0.4.0.rc10/lib/gamebox/core/stage.rb:145:in `instance_eval'
/Users/jakob/.rvm/gems/ruby-1.9.3-p194@gamebox/gems/gamebox-0.4.0.rc10/lib/gamebox/core/stage.rb:145:in `define'
/Users/jakob/.rvm/gems/ruby-1.9.3-p194@gamebox/gems/gamebox-0.4.0.rc10/lib/gamebox/core/core.rb:13:in `define_stage'
/Users/jakob/Projects/games/zapper/src/demo_stage.rb:1:in `<top (required)>'
/Users/jakob/.rvm/gems/ruby-1.9.3-p194@gamebox/gems/require_all-1.2.1/lib/require_all.rb:109:in `require'
/Users/jakob/.rvm/gems/ruby-1.9.3-p194@gamebox/gems/require_all-1.2.1/lib/require_all.rb:109:in `block in require_all'
/Users/jakob/.rvm/gems/ruby-1.9.3-p194@gamebox/gems/require_all-1.2.1/lib/require_all.rb:107:in `each'
/Users/jakob/.rvm/gems/ruby-1.9.3-p194@gamebox/gems/require_all-1.2.1/lib/require_all.rb:107:in `require_all'
/Users/jakob/Projects/games/zapper/config/environment.rb:27:in `<top (required)>'
/Users/jakob/Projects/games/zapper/Rakefile:6:in `<top (required)>'
/Users/jakob/.rvm/gems/ruby-1.9.3-p194@gamebox/bin/ruby_noexec_wrapper:14:in `eval'
/Users/jakob/.rvm/gems/ruby-1.9.3-p194@gamebox/bin/ruby_noexec_wrapper:14:in `<main>'
(See full trace by running task with --trace)

Not sure what I am doing wrong, or what the correct instructions in the README should've been.

shawn42 commented 11 years ago

@koppen you are correct. I'm not sure how to better "system" test the generated game application short of manually doing so on every release. I'd love to hear some ideas.

koppen commented 11 years ago

Thanks for the fix, it works now.

As for a way to test the template, I am not sure. The only way I can see is to write a test that actually runs the generator script and does some kind of sanity check on the results.

Although actually running the generated game wouldn't be good for an automated test, as it'd end up waiting on an infinite game loop. I must admit I am coming up blank here.