Ruby equivalent of virtualenv?

dbr picture dbr · Jan 28, 2009 · Viewed 57.3k times · Source

Is there something similar to the Python utility virtualenv?

Basically it allows you to install Python packages into a sandboxed environment, so easy_install django doesn't go in your system-wide site-packages directory, it would go in the virtualenv-created directory.

For example:

$ virtualenv test
New python executable in test/bin/python
Installing setuptools...cd .........done.
$ cd test/
$ source bin/activate
(test)$ easy_install tvnamer
Searching for tvnamer
Best match: tvnamer 0.5.1
Processing tvnamer-0.5.1-py2.5.egg
Adding tvnamer 0.5.1 to easy-install.pth file
Installing tvnamer script to /Users/dbr/test/bin

Using /Library/Python/2.5/site-packages/tvnamer-0.5.1-py2.5.egg
Processing dependencies for tvnamer
Finished processing dependencies for tvnamer
(test)$ which tvnamer 
/Users/dbr/test/bin/tvnamer

Is there something like this for RubyGems?

Answer

Van Nguyen picture Van Nguyen · Sep 27, 2010

RVM works closer to how virtualenv works since it lets you sandbox different ruby versions and their gems, etc.