Forums Archived

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

Getting to work on linux

Get help and support with Rubygame

Getting to work on linux

Postby alc » Sun Jan 10, 2010 2:08 pm

Hi, I have OpenSuse, KDE environment and had installed correctly (I guess)... Here is how I did:

Code: Select all
gem install Download/rubygame-2.6.2
Successfully installed rubygame-2.6.2                         
1 gem installed                                               
Installing ri documentation for rubygame-2.6.2...             
Installing RDoc documentation for rubygame-2.6.2...


I Have ruby 1.8.7, libsdl 1.2 and the others sdl required packages
When I try to run a sample from the rubygame-2.6.2.tar.bz2 that I downloaded I get the following error

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


where line 5 in the *.rb is require "rubygame"
I not really sure what did I miss. I have try on Ubuntu, gnome environment, but got the same problem.

Any help would be appreciated!
alc
 
Posts: 1
Joined: Sun Jan 10, 2010 1:45 pm

Re: Getting to work on linux

Postby shawn42 » Tue Jan 12, 2010 2:26 am

I'm not sure that the ruby package on your distro includes setting the RUBYOPT environment variable. Basically, ruby or in this case rsdl, needs to be told that you're going to use rubygems. This can happen one of three ways.
    RUBYOPT environment variable
    -rubygems as a command line argument
    require 'rubygems' in your script before you try to require 'rubygame'

So, to confirm this: try to run
Code: Select all
rsdl -rubygems myscript.rb
User avatar
shawn42
 
Posts: 109
Joined: Tue Feb 10, 2009 8:22 pm

Re: Getting to work on linux

Postby jacius » Tue Jan 12, 2010 11:48 pm

shawn42 wrote:So, to confirm this: try to run
Code: Select all
rsdl -rubygems myscript.rb

"rsdl" is only for Mac. On Linux, you just use "ruby". :D

Code: Select all
ruby -rubygems myscript.rb

You can also try this:

Code: Select all
RUBYOPT="rauto_gem" ruby myscript.rb

If that helps, edit your ~/.bash_profile file to add this line:

Code: Select all
export RUBYOPT="rauto_gem"

Then log out and back in to your computer, and "ruby myscript.rb" should work fine.
User avatar
jacius
Site Admin
 
Posts: 131
Joined: Fri Feb 06, 2009 11:13 pm

Re: Getting to work on linux

Postby shawn42 » Tue Jan 12, 2010 11:53 pm

Heh, thanks jacius. I got two posts mixed up in my head while writing a response! :oops:
User avatar
shawn42
 
Posts: 109
Joined: Tue Feb 10, 2009 8:22 pm


Return to Help & Support

Who is online

Users browsing this forum: No registered users and 1 guest

cron