Virtual Ruby?

Posted by Nick Sieger Tue, 02 May 2006 18:56:00 GMT

I had a chance to dabble around with Python a tiny bit today, building the XSV XML schema validator. Got it working fairly easily on my MacBook Pro after a minor detour. Later, I needed to build another copy on a shared linux dev box where I didn’t have root access. Now how does this work in Python? Fortunately, the answer was close at hand: a virtual python instance. Nice! You can create a replica of the main python install, and add your personal site-packages there. The only thing that gets copied is the python executable plus a bunch of symlinks to the main libraries and packages. After that point all you need to do is put your virtual python executable ahead of the main executable on your PATH.

If I were to install local packages/gems with Ruby, I’d probably either build my own Ruby or maintain a local packages directory and constantly customize RUBYLIB. Seems like a suboptimal solution. Has anyone attempted a virtual-ruby.rb that does the same as virtual-python.py?

Posted in  | 3 comments | no trackbacks

Comments

  1. Avatar dcgrigsby said 1 day later:

    Isn’t this what RubyScript2Exe (http://www.erikveen.dds.nl/rubyscript2exe/index.html) does, only that it also puts it all into one file (which, btw, can be “compiled” for most platforms)

  2. Avatar dcgrigsby said 1 day later:

    BTW, you could use the --eee-justextract method on the RubScript2Exe to extract the files like a self extracting archive. Then you’d have your complete environment right there, no?

  3. Avatar Nick said 2 days later:

    Not a bad idea. They seem like slightly different problems -- one is how to maintain multiple versions of your interpreter and environment on the same machine, and the other was made firstly for packaging.

Trackbacks

Use the following link to trackback from your own site:
http://blog.nicksieger.com/articles/trackback/5