Forums Archived

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

Problems installing Ruby Games

Get help and support with Rubygame

Problems installing Ruby Games

Postby gtg287y » Mon Jul 19, 2010 3:10 pm

I'm not really familiar with using libraries in Ruby, so this is probably a basic issue:

I downloaded RubyGame from the downloads link, and then untarred it (I'm in OpenSuse linux) and read the "README" file inside. It said to just install it as a gem, by doing "sudo gem install rubygame". This seemed to work just fine (though it confused me, if it's already a gem, what/why did I download?

However, when I tried to run a sample file I got:

Code: Select all
demo_rubygame.rb:25:in `require': no such file to load -- rubygame (LoadError)
   from demo_rubygame.rb:25


I checked the rubygame wiki, and it seemed to imply that all I needed to do what that gem install. The windows install guide mentioned trying "require 'rubygame" from the irb, and that didn't work either.

Is there something other than the gem I need to install? Do I need to put the tar file I downloaded somewhere specific? I didn't see any errors or issues while installing rubygame...all the dependencies seemed to work just fine.
gtg287y
 
Posts: 1
Joined: Mon Jul 19, 2010 3:04 pm

Re: Problems installing Ruby Games

Postby jacius » Mon Jul 19, 2010 8:14 pm

gtg287y wrote:I downloaded RubyGame from the downloads link, and then untarred it (I'm in OpenSuse linux) and read the "README" file inside. It said to just install it as a gem, by doing "sudo gem install rubygame". This seemed to work just fine (though it confused me, if it's already a gem, what/why did I download?

What you downloaded was the source package. You can install from that too, using "rake install". But, because Rubygame depends on several other Ruby libraries, it's easiest to install the gem and let it install the dependencies for you.

gtg287y wrote:However, when I tried to run a sample file I got:

Code: Select all
demo_rubygame.rb:25:in `require': no such file to load -- rubygame (LoadError)
   from demo_rubygame.rb:25

If you are using Ruby 1.8, you must tell Ruby to load Rubygems, otherwise it won't find any libraries installed as a gem. To do that, add this line to your ~/.bash_profile file:
Code: Select all
export RUBYOPT="rubygems"

That will cause the RUBYOPT environment variable to be set each time you log in to your computer. To make it have effect immediately (without logging in again), you can also enter that same line into your shell. (You won't need to do that anymore after you have logged in again in the future.)

Ruby should now be able to find and load Rubygame. :)
User avatar
jacius
Site Admin
 
Posts: 131
Joined: Fri Feb 06, 2009 11:13 pm


Return to Help & Support

Who is online

Users browsing this forum: No registered users and 1 guest

cron