Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > ruby-opengl on Mac OS X

Reply
Thread Tools

ruby-opengl on Mac OS X

 
 
Robert Poor
Guest
Posts: n/a
 
      09-20-2007
All: Pardon this noobish question. I'm trying to bring up ruby-opengl
on my Mac OS X (v 10.4.10).

I ran "sudo gem install ruby-opengl" without any trouble -- gem
announced that it was loading ruby-opengl 0.40.1 as well as mkrf-0.2.2
-- so far so good! I poked around and found that it had installed the
following file (among others):

/usr/local/lib/ruby/gems/1.8/gems/ruby-opengl-0.40.1/lib/opengl.rb

This looks hopeful. In irb, I typed:

irb(main):106:0> require 'opengl'

which resulted in:

LoadError: no such file to load -- opengl
from
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
`gem_original_require'
from
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
`require'
from (irb):106
from /usr/local/lib/ruby/site_ruby/1.8/rubygems.rb:399

My question: My guess is this is a problem with paths. What is the
cleanest remedy? Do I extend my path, make symbolic links, or move the
opengl files?

Thanks.

- ff
--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
 
 
 
Gregory Seidman
Guest
Posts: n/a
 
      09-20-2007
On Thu, Sep 20, 2007 at 01:31:38PM +0900, Robert Poor wrote:
> All: Pardon this noobish question. I'm trying to bring up ruby-opengl
> on my Mac OS X (v 10.4.10).
>
> I ran "sudo gem install ruby-opengl" without any trouble -- gem
> announced that it was loading ruby-opengl 0.40.1 as well as mkrf-0.2.2
> -- so far so good! I poked around and found that it had installed the
> following file (among others):
>
> /usr/local/lib/ruby/gems/1.8/gems/ruby-opengl-0.40.1/lib/opengl.rb
>
> This looks hopeful. In irb, I typed:
>
> irb(main):106:0> require 'opengl'
>
> which resulted in:
>
> LoadError: no such file to load -- opengl
> from
> /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
> `gem_original_require'
> from
> /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
> `require'
> from (irb):106
> from /usr/local/lib/ruby/site_ruby/1.8/rubygems.rb:399
>
> My question: My guess is this is a problem with paths. What is the
> cleanest remedy? Do I extend my path, make symbolic links, or move the
> opengl files?


I think you want to require 'gl' rather than 'opengl'. With a working
install of ruby-opengl on 10.4.10 I have the following in a working Ruby
script:

require 'rubygems'
require 'gl'
require 'glu'
require 'glut'

You don't need GLU or GLUT unless you're using them, mind you.

> Thanks.
> - ff

--Greg


 
Reply With Quote
 
 
 
 
Fearless Fool
Guest
Posts: n/a
 
      09-20-2007
Gregory Seidman wrote:
> ...
> I think you want to require 'gl' rather than 'opengl'. With a working
> install of ruby-opengl on 10.4.10 I have the following in a working Ruby
> script:
>
> require 'rubygems'
> require 'gl'
> require 'glu'
> require 'glut'
>
> You don't need GLU or GLUT unless you're using them, mind you.
>
> --Greg


Greg:

Whoo hoo! It Just Works. Many thanks.

- Rob
--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
Sy Yoon
Guest
Posts: n/a
 
      10-12-2007
Fearless Fool wrote:
> Gregory Seidman wrote:
>> ...
>> I think you want to require 'gl' rather than 'opengl'. With a working
>> install of ruby-opengl on 10.4.10 I have the following in a working Ruby
>> script:
>>
>> require 'rubygems'
>> require 'gl'
>> require 'glu'
>> require 'glut'
>>
>> You don't need GLU or GLUT unless you're using them, mind you.
>>
>> --Greg

>
> Greg:
>
> Whoo hoo! It Just Works. Many thanks.
>
> - Rob


Hello, Greg and Rob, Sorry for my newbie question in advance.

I am in very similar situation as Rob was in: I installed
ruby-opengl-0.40.1
in OS X(v. 10.4.10), and found 'opengl.rb' and others in

/usr/local/lib/ruby/gems/1.8/gems/ruby-opengl-0.40.1/lib/opengl.rb

But when I do irb(main):003:0> require 'gl'
I get the following error:


LoadError: Failed to lookup Init function ./gl.bundle
from ./gl.bundle
from (irb):2

(Well, 'opengl.rb' file contains line "require 'gl'" anyway, but when I
do
irb(main):003:0> require 'opengl', I receive:
LoadError: Failed to lookup Init function ./gl.bundle
from ./gl.bundle
from ./opengl.rb:16
from (irb):1:in `require'
from (irb):1 )

I also tried to test run 'plane.rb' file located in
/usr/local/lib/ruby/gems/1.8/gems/ruby-opengl-0.40.1/lib/examples
using TextMate and got the following:

/Volumes/TextMate1.5.5/TextMate.app/Contents/SharedSupport/Support/lib/
scriptmate.rb:107:in `initialize': Permission denied -
/usr/local/lib/ruby/gems/1.8/gems/ruby-opengl-0.40.1/examples/plane.rb
(Errno::EACCES) from /Volumes/TextMate

What am I doing wrong?


Sy


--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
Julian Raschke
Guest
Posts: n/a
 
      10-12-2007
Hi,

> /Volumes/TextMate1.5.5/TextMate.app/Contents/SharedSupport/Support/lib/
> scriptmate.rb:107:in `initialize': Permission denied -
> /usr/local/lib/ruby/gems/1.8/gems/ruby-opengl-0.40.1/examples/plane.rb
> (Errno::EACCES) from /Volumes/TextMate
>
> What am I doing wrong?


I think TextMate needs write access to files to run them (bug?). I had
the very same problem yesterday, even with a 'properly' installed
TextMate, and I ended up copying the example .rb files to the Desktop.
Could run them from there without problems.

Julian


 
Reply With Quote
 
Sy Yoon
Guest
Posts: n/a
 
      10-12-2007
Julian Raschke wrote:
> Hi,
>
>> /Volumes/TextMate1.5.5/TextMate.app/Contents/SharedSupport/Support/lib/
>> scriptmate.rb:107:in `initialize': Permission denied -
>> /usr/local/lib/ruby/gems/1.8/gems/ruby-opengl-0.40.1/examples/plane.rb
>> (Errno::EACCES) from /Volumes/TextMate
>>
>> What am I doing wrong?

>
> I think TextMate needs write access to files to run them (bug?). I had
> the very same problem yesterday, even with a 'properly' installed
> TextMate, and I ended up copying the example .rb files to the Desktop.
> Could run them from there without problems.
>
> Julian


Ok, I copied an exmple rb file to the Desktop where TextMate is, but
still get:

LoadError: Failed to lookup Init function
/usr/local/lib/ruby/gems/1.8/gems/ruby-opengl-0.40.1/lib/gl.bundle

method require in custom_require.rb at line 32
at top level in gl-test.rb at line 46

???

BTW, my TextMate is a trial version.

Sy

--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
Jesús Gabriel y Galán
Guest
Posts: n/a
 
      10-12-2007
On 10/12/07, Sy Yoon <> wrote:
> Julian Raschke wrote:
> > Hi,
> >
> >> /Volumes/TextMate1.5.5/TextMate.app/Contents/SharedSupport/Support/lib/
> >> scriptmate.rb:107:in `initialize': Permission denied -
> >> /usr/local/lib/ruby/gems/1.8/gems/ruby-opengl-0.40.1/examples/plane.rb
> >> (Errno::EACCES) from /Volumes/TextMate
> >>
> >> What am I doing wrong?

> >
> > I think TextMate needs write access to files to run them (bug?). I had
> > the very same problem yesterday, even with a 'properly' installed
> > TextMate, and I ended up copying the example .rb files to the Desktop.
> > Could run them from there without problems.
> >
> > Julian

>
> Ok, I copied an exmple rb file to the Desktop where TextMate is, but
> still get:
>
> LoadError: Failed to lookup Init function
> /usr/local/lib/ruby/gems/1.8/gems/ruby-opengl-0.40.1/lib/gl.bundle
>
> method require in custom_require.rb at line 32
> at top level in gl-test.rb at line 46
>
> ???
>
> BTW, my TextMate is a trial version.


Don't know if it might be the same problem, but just in case. I was
trying to install opengl in Ubuntu, but couldn't make it work, until
someone pointed to me that opengl.0.40.1 required version 1.9+ of
rubygems. So maybe you could try to upgrade to version 1.9 to see if
that's the problem?

In Ubuntu:

sudo gem update --system

Don't know how to do it in Mac OS X, though.

Hope this helps,

Jesus.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
2811 snmp for what mac's are on which port ( simliar to thesh mac-add ) ab Cisco 0 02-12-2007 08:26 PM
Image quality on .mac (dot mac) eyalnevo@gmail.com Digital Photography 4 05-16-2006 03:07 PM
Vertical Gap between DIVs in Opera 8.5 Mac + IE 5.2 Mac mangm HTML 2 12-01-2005 12:48 PM
mac!! mac!!! * * * Y o u r . S h e p h e r d . A q u i l a . D e u s . ( d 2 0 0 5 x x , d 2 0 0 4 x x , d 2 0 0 Computer Support 7 06-03-2005 12:48 AM
Senseless rendering: Mac.Mozilla != Mac.Netscape6.01 ?!?! Roman =?ISO-8859-15?Q?Bl=F6th?= HTML 1 07-02-2003 10:23 AM



Advertisments