Not logged inGosu Forums
Forum Gosu Homepage Help Search Register Login
Up Topic Gosu / Extending Gosu / ruby-opengl gem for Windows
- By ? Date 2009-11-29 09:34
Hi.
I tried to install ruby-opengl but I always get this error:
http://img228.imageshack.us/img228/7857/screendt.png
Help? :(
- By banister Date 2009-11-29 17:34
hi,

i already filed a bug report about this error to the maintainers.

If you directly download the appropriate gem from this site http://rubyforge.org/frs/?group_id=2103 and get into the download directory and then type 'gem install ruby-opengl-0.60.1-x86-mswin32-ruby19.gem" for example, it should work.

let me know if you still have problems

banister
- By ? Date 2009-11-29 20:19
Thanks, opengl works now :)
- By Trebor777 Date 2009-11-29 22:27
oh by the way :) this  mswin32 build isn't compatible with the RubyInstaller 1.9.1rc1, which use Mingw.
I had to follow the patch a guy did to several files, in order to be able to compile it properly...
- By josephhowse Date 2010-05-02 13:32
Apparently, ruby-opengl-0.60.1-x86-mswin32-ruby19.gem also doesn't work with the RubyInstaller version of Ruby 1.9.1-p378.

I encounter the same problem as others have reported here here:

http://rubyforge.org/tracker/index.php?func=detail&aid=26054&group_id=2103&atid=8185

Has anyone had success in patching this?
- - By Trebor777 Date 2010-06-12 13:48
hey, been a little while, but
it works for me :) and for some friends too, so I decided to share it:

Here is a zip file, containing the precompiled ( by me, after patching ages ago,  i don't remember any of it xD , but it works )
-> install ruby-opengl, and wait for it to fail to install
-> unpack the 3 folders included in the zip,  in the opengl gem folder, and replace the stuff.
-> unpack the glut32.dll in the ruby/bin folder

and enjoy !

http://dl.dropbox.com/u/167380/ruby-opengl-0.60.1.zip
Parent - By josephhowse Date 2010-06-17 10:42
Thanks for the patched version, Trebor777!!!  It works for me too.
Parent - - By RunnerPack Date 2011-02-25 04:48
Well, neither this nor the official 0.60.1 win32 build works with 1.9.2, due to this problem caused by a deprecated Ruby C API macro (STR2CSTR). As noted in the linked article, the ruby-opengl maintainers seem to have skipped town and left a lot of folks (including me) high and dry!

Is there any kind soul out there (running windows and able to build gems from source) who would like to perform the patch, build the gem, and make another zip?

I've tried compiling it myself, but I think there are some path issues, because ruby's "config.h" isn't being found, even though it's right there at "C:\Ruby\include\ruby-1.9.1\i386-mingw32\ruby\config.h". I don't want to install the RubyInstaller "devkit" because I already have both cygwin and MinGW installed, and I don't think I should be forced to install yet another gcc x86 tool-chain! However, if someone has instructions on how to get rubygems to use my existing MinGW/MSYS setup to compile gems, I'll perform the patching, compiling, and zipping and put the new version up here for others. I've attached the output of the gem install command.
Attachment: opengl_gem_fail.txt - Output of the failed gem build. (0B)
Parent - - By Spooner Date 2011-02-25 13:49
Ah, that does, at least, explain why it won't install. I can't give you any help there, but I'd really like to have a working opengl available! I tried ffi-opengl instead, but I have problems running any ffi stuff for some reason (1.9.2 win7 x64)
Parent - By RunnerPack Date 2011-02-26 05:08
Same results with FFI here :/ Although, I haven't really tried any FFI extensions other than the opengl one.
Parent - - By RunnerPack Date 2011-03-31 05:03
I got it! I finally found the definitive, ultimate, complete... (you get the idea ;) method for installing ruby-opengl 0.60.1 in RubyInstaller 1.9.2!

Just read the instructions here: https://groups.google.com/d/msg/rubyinstaller/vMR5mQVA_88/aZqLyjyQiSYJ and then get the zip in the next post and read its readme. There are a couple of caveats:

1. it requires the "devkit" that the RubyInstaller people provide. If you don't want to install it (it's not a big deal to install, but I can see why some might not want to) just ask and I'll provide working binaries here.

2. There was some weirdness with Ruby's "config.h" being in the wrong folder on my system. I don't know if I messed it up or what, but if you get an error during gem install about "config.h: no such file" or similar, just copy it from "C:\Ruby\include\ruby-1.9.1\i386-mingw32\ruby\config.h" to "C:\Ruby\include\ruby-1.9.1\ruby\config.h" (adjusting paths as necessary). Note: the "1.9.1" part is not a typo.

Happy Ruby-ing, Gosu-ing, and OpenGL-ing! :D
Parent - - By Dahrkael Date 2011-03-31 18:09
id love those working binaries, too many steps <.<
Parent - - By RunnerPack Date 2011-03-31 22:30
There aren't that many if you use the zipfile, but here it is, anyway. Just unzip to your root Ruby folder, preserving paths.
Attachment: opengl.7z - Precompiled ruby-opengl 0.60.1 gem for win32 RubyInstaller 1.9.2 (0B)
Parent - - By Dahrkael Date 2011-04-02 19:15
ruby doesnt detect it :|
gem list --local doesnt show it and examples doesnt run.
.gem somewhere? <.<
Parent - - By RunnerPack Date 2011-04-02 20:30 Edited 2011-04-03 08:10
I don't know how to repackage as a gem. Maybe you could install the non-working one, then just replace the files. Actually, now that I think of it, maybe I can just replace the files inside the binary gem...

*** EDIT ***

I tried to "manually" create a gem by recreating the internal structure using the new files, but when I try to install it, I get the following error:

$ gem ins ruby-opengl-0.60.1-x86-mingw32-ruby19.gem
ERROR:  While executing gem ... (Zlib::DataError)
    invalid code lengths set

I've tried using 7zip and gzip (from the RubyInstaller devkit) and I get the same error. Help?
Parent - - By Dahrkael Date 2011-04-03 11:29
i downloaded the ruby-opengl-0.60.1-x86-mingw32-ruby19.gem from rubyforge, installed it and replaced the folder. now everything works perfectly \o/
Parent - By RunnerPack Date 2011-04-04 02:24
Excellent! It's actually "ruby-opengl-0.60.1-x86-mswin32-ruby19.gem, but close enough ;) I'm just posting this for clarity, so others don't get confused about what file they need (although, if the maintainers ever do make a "mingw32" version of the gem, this thread will be useless, anyway).

I can't wait to see the cool stuff you make! :D
Parent - - By lol_o2 Date 2011-05-13 13:33
This solution isn't so ultimate, because OpenGL still can't be compiled with Ocra.
Parent - - By RunnerPack Date 2011-05-14 17:54
Well, I just tried Ocra (for the first time) and it didn't work, but the error was "no such file to load: gosu," so I don't think it's a problem with the OpenGL gem. Does Ocra work for you with plain gosu apps (which don't use OpenGL)? What is the error you're getting? If it's just a "not found" error like mine, maybe there are Ocra command-line options that would help.
Parent - By lol_o2 Date 2011-05-14 19:31
Other gems are working. My error is "no such file to load: gl", so the same error as previously on 1.9.2  OpenGL gem depends on mkrf and rake, but doesn't work even compiled with them.
Parent - - By lol_o2 Date 2011-06-05 19:50
Hey guy! Will you ever answer? I NEED THE SOLUTION.

BTW, I made something myself. I copied ruby-opengl's lib directory along with executable and changed a bit some files. It's an ugly idea and this directory has above 8MB, but it works.
Parent - - By RunnerPack Date 2011-06-08 11:42
First of all, yelling at me will not make me want to answer you faster.

Secondly, you didn't really ask me anything, or even provide any new information I can use to help.

Finally, I've already explained I know next to nothing about Ocra. It might be time to ask the Ocra developers, or at least try a forum with a lot of Ocra users, since this has nothing to do with Gosu or the subject of this thread.
Parent - - By lol_o2 Date 2011-06-08 18:02
Sorry for the yelling. I just wanted to compile my game and I couldn't because of this gem. I thought you are going to do something with it (aren't you?).
But I compressed that directory to 2MB and now fixing Ocra doesn't really matter.
Parent - - By jlnr (dev) Date 2011-06-08 23:00
You can still help the technical progress of the entire planet though and yell at the author of ocra :) (though by my experience with ruby-opengl, it might just be one of its quirks...)
Parent - By Spooner Date 2011-06-09 02:28
I shouted at the Ocra guy about ActiveRecord not being Ocrable and it was fixed within a week or so...

So give it a try :)
- By RunnerPack Date 2010-06-14 06:58
Thanks! It works great both with and without gosu!
- By kyonides Date 2010-06-14 15:13
But Trebor's suggestion isn't valid for Linux...
- By Trebor777 Date 2010-06-15 11:52
well if you can read the title of this topic, you can expect it's not going to be for Linux, or OSx.
- By kyonides Date 2010-06-15 20:38
Since I have the same issue on Linux, I was expecting someone would provide some Linux support, too. I thought it was stated "implictly" here. I guess no one knows how that could be fixed there, yet.
- By RunnerPack Date 2010-06-16 05:04
kyonides:

> Since I have the same issue on Linux, I was
> expecting someone would provide some Linux support,
> too. I thought it was stated "implictly" here. I
> guess no one knows how that could be fixed there,
> yet.


I'm no "Linux power-user" but if you start a new thread and post your exact error messages (including trying to get a trace of what rubygems is trying to do during the build) I may be able to help. And if I can't, someone else will, for sure.

OTOH, I would first see if you have libGL itself installed, and that it's the latest version (read: the version the gem wants). Of course, this assumes you know you have gcc and the other stuff needed to build native gems...
- By jlnr (dev) Date 2010-06-16 05:43
Well, Gosu needs libGL and gcc too on Linux. Maybe not the latest version of libGL, but it seems it's really more of a general ruby-opengl problem. Not sure if they have an issue tracker either.
- - By Trebor777 Date 2011-07-17 13:32 Edited 2011-07-18 18:44
Read next Reply please!
Parent - - By Trebor777 Date 2011-07-18 15:23 Edited 2011-07-18 18:44
After seeing some people struggling with the build of the gem on Windows.
I manage to create a valid gem containing only the binaries. :)

Please test!
http://dl.dropbox.com/u/167380/ruby-opengl-0.60.1-x86-mingw32-ruby19.gem
Attachment: ruby-opengl-0.60.1-x86-mingw32-ruby19.gem - Ruby Opengl Windows Only(updated with dll auto added to PATH) (0B)
Parent - By Atnas Date 2011-08-08 21:17
Sorry for bumping something so old... But I have to say YES. It works. Thank you so much for doing this. : D I've been struggling to get this to work for myself for over a year, and here you go making it so simple!
Up Topic Gosu / Extending Gosu / ruby-opengl gem for Windows

Powered by mwForum 2.29.1 © 1999-2013 Markus Wichitill