Forums Archived

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

The .rb Files wont even Load!

Get help and support with Rubygame

The .rb Files wont even Load!

Postby cavygalaxy » Tue Oct 27, 2009 2:59 am

:x So, Whenever i try to load a .rb file, Rubygame or not, it wont load. The assumed "Error List" disappears Before i can even look at it! :evil: It makes me very sad. :cry:
Cannibal Troll
A troll that trolls other trolls, thus making the internet a better place
User avatar
cavygalaxy
 
Posts: 18
Joined: Tue Oct 27, 2009 2:35 am

Re: The .rb Files wont even Load!

Postby tyler » Tue Oct 27, 2009 4:26 am

So are you saying this is a problem with Ruby or Rubygame? What OS are you running? What code did you use? Are you running the file by double clicking on it, or from the command line?

No one can help unless they know specifics.
tyler
 
Posts: 25
Joined: Sat Feb 28, 2009 6:10 am

Re: The .rb Files wont even Load!

Postby cavygalaxy » Tue Oct 27, 2009 5:01 am

So are you saying this is a problem with Ruby or Rubygame? What OS are you running? What code did you use? Are you running the file by double clicking on it, or from the command line?

Rubygame. Windows XP Home Edition. I used To the exit... again (look up "to the exit...again" WITH quotes on google). And Both.
Cannibal Troll
A troll that trolls other trolls, thus making the internet a better place
User avatar
cavygalaxy
 
Posts: 18
Joined: Tue Oct 27, 2009 2:35 am

Re: The .rb Files wont even Load!

Postby cavygalaxy » Tue Oct 27, 2009 10:59 am

and yes, i did install sdl and all other files.
Cannibal Troll
A troll that trolls other trolls, thus making the internet a better place
User avatar
cavygalaxy
 
Posts: 18
Joined: Tue Oct 27, 2009 2:35 am

Re: The .rb Files wont even Load!

Postby shawn42 » Tue Oct 27, 2009 3:34 pm

could you post the stacktrace online for us to view.. maybe a gist or pastie?

http://gist.github.com/gists/new

It should give us a little more insight into you problem.
User avatar
shawn42
 
Posts: 109
Joined: Tue Feb 10, 2009 8:22 pm

Re: The .rb Files wont even Load!

Postby cavygalaxy » Tue Oct 27, 2009 8:23 pm

a what?

ok, i'll use a different file. i made it from scratch.i dont see anything wrong with it, here's the code:
Code: Select all
require "rubygame"
puts "made with Ruby"
puts "and with Rubygame"
bgmusic = Music.load(audio\bgmusic.mp3)
bgmusic.play(options={:fade_in => 0, :repeats => -1, :start_at => 0})

Is there anything wrong with the code? :?:
Cannibal Troll
A troll that trolls other trolls, thus making the internet a better place
User avatar
cavygalaxy
 
Posts: 18
Joined: Tue Oct 27, 2009 2:35 am

Re: The .rb Files wont even Load!

Postby shawn42 » Tue Oct 27, 2009 8:54 pm

basically, I was asking for the output you get from running your code.

Are you just double-clicking on it? If so, open a cmd prompt (start => run, type in cmd, hit enter)

cd /your/dir/to/code
ruby myapp.rb

you should see output scroll by.. I'd like to see that to help determine the error.

also, rubygame is probably installed with rubygems, so you should either run your script with:
ruby -rubygems myapp.rb
OR
add:
require "rubygems" to the top of your script.
User avatar
shawn42
 
Posts: 109
Joined: Tue Feb 10, 2009 8:22 pm

Re: The .rb Files wont even Load!

Postby cavygalaxy » Tue Oct 27, 2009 11:30 pm

i did both and i got this error:
Code: Select all
game.rb:5: syntax error, unexpected $undefined, expecting ')'
bgmusic = Music.load(audio\bgmusic.mp3)
                           ^
game.rb:5: syntax error, unexpected ')', expecting $end

i do not see what is wrong.
User avatar
cavygalaxy
 
Posts: 18
Joined: Tue Oct 27, 2009 2:35 am

Re: The .rb Files wont even Load!

Postby tyler » Tue Oct 27, 2009 11:38 pm

bgmusic = Music.load(audio\bgmusic.mp3)


You forgot the double quotes:

Code: Select all
bgmusic = Music.load("audio\bgmusic.mp3")


Off topic:
You used To the exit... again, as in the one I made?. How'd you find out about it?
tyler
 
Posts: 25
Joined: Sat Feb 28, 2009 6:10 am

Re: The .rb Files wont even Load!

Postby cavygalaxy » Tue Oct 27, 2009 11:39 pm

i figured out the problem, but i still get an error saying that it cant find the file. supposedly, subdirectories are Not \, but /. and btw tyler, i googled a ruby platformer.
UPDATE: i was wrong, thanks, tyler. but, it doesn't recognize Rubygame! :x is there anything wrong with this?
Code: Select all
require "rubygems"
require "rubygame"
puts "made with Ruby"
puts "and with Rubygame"
bgmusic = Music.load("audio\bgmusic.mp3")
bgmusic.play(options={:fade_in => 0, :repeats => -1, :start_at => 0})
Cannibal Troll
A troll that trolls other trolls, thus making the internet a better place
User avatar
cavygalaxy
 
Posts: 18
Joined: Tue Oct 27, 2009 2:35 am

Next

Return to Help & Support

Who is online

Users browsing this forum: No registered users and 1 guest

cron