lundi 21 avril 2014

Puis-je passer des versions de Ruby dynamiquement à l'aide de RVM ? -Débordement de pile


I'm working on building a GUI for my checkers implementation. I'm utilizing a GUI framework that only works with Ruby 1.8, yet my game engine, which I have packaged as a gem, only works with Ruby 1.9.


I can't change the code for the GUI framework and reworking my game engine to make it compatible with 1.8 is undesirable, to say the least.


I'm using RVM though, and it looks like you can write RVM scripts to change Ruby versions on the fly.


Does anyone have any experience with that or what the script might look like?




You could run it in two processes. Give the GUI a 1.8 process and talk to it via a shared db or an API on the other side. That's how I'd do it. The good part about that is you can have on online version of your game as well because other clients will be able to talk to it as well.




You can't run one app with two versions of Ruby. How do you imagine this?


RVM has an ability to automatically change current ruby when you cd into a directory. Just create in that directory a file called .rvmrc with content like


rvm use 1.8.7


I'm working on building a GUI for my checkers implementation. I'm utilizing a GUI framework that only works with Ruby 1.8, yet my game engine, which I have packaged as a gem, only works with Ruby 1.9.


I can't change the code for the GUI framework and reworking my game engine to make it compatible with 1.8 is undesirable, to say the least.


I'm using RVM though, and it looks like you can write RVM scripts to change Ruby versions on the fly.


Does anyone have any experience with that or what the script might look like?



You could run it in two processes. Give the GUI a 1.8 process and talk to it via a shared db or an API on the other side. That's how I'd do it. The good part about that is you can have on online version of your game as well because other clients will be able to talk to it as well.



You can't run one app with two versions of Ruby. How do you imagine this?


RVM has an ability to automatically change current ruby when you cd into a directory. Just create in that directory a file called .rvmrc with content like


rvm use 1.8.7

0 commentaires:

Enregistrer un commentaire