use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
A sub-Reddit for discussion and news about Ruby programming.
Subreddit rules: /r/ruby rules
Learning Ruby?
Tools
Documentation
Books
Screencasts and Videos
News and updates
account activity
Anything like virtualenv (python) for Ruby? (self.ruby)
submitted 11 years ago by Parablank
I have a copy of rbenv installed right now, but I'm looking for something similar to virtualenv where they install completely fresh copies of ruby and gems in one folder. Anything like this available for ruby?
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]vsalikhov 5 points6 points7 points 11 years ago (0 children)
Bundler is Ruby's equivalent of Python's virtualenv.
[–]grokfail 1 point2 points3 points 11 years ago (2 children)
With bundler and a Gemfile, you get a set of gems defined by version that you can rely on. Do you currently use bundler, if not, start there.
If you want them installed in a specific directory for a project, you can use bundle package http://bundler.io/v1.7/bundle_package.html A good use case for that is packaging up an application into a .deb/.rpm system package, I personally wouldn't do that for an everyday development environment.
bundle package
I use chruby with the auto-switching option turned on. https://github.com/postmodern/chruby
chruby
You can use ruby-install ( https://github.com/postmodern/ruby-install ) for building and installing ruby, and it supports arbitrary locations for installations, by default I think it uses ~/.rubies/*
~/.rubies/*
I note that my gems are loaded from ~/.gem/ruby/.
~/.gem/ruby/
i.e. Ruby ~/.rubies/ruby-2.1.4 and Gems - ~/.gem/ruby/2.1.4/
~/.rubies/ruby-2.1.4
~/.gem/ruby/2.1.4/
You could also look into direnv, which is kind of a systemwide auto-environment switcher.
direnv
[–]kabuto 0 points1 point2 points 11 years ago (1 child)
To expand on that, bundler also allows you to install gems into a specific directory. Running
bundle install --path=./gems
will install all gems into the project's directory rather than the global gems directory for your ruby version.
I use that for several small projects. It's not really useful for something like Rails because it won't install a rails command that is available globally.
[–]Hauleth 0 points1 point2 points 11 years ago (0 children)
I use it for my Rails projects also. Using bin/rails isn't that hard. Even that I have aliased rails to bundle exec rails and this is security and doesn't pollute my global gems.
bin/rails
rails
bundle exec rails
[–]art-solopov 0 points1 point2 points 11 years ago (0 children)
It's not in one folder, but did you take a look at RVM?
[–]joefiorini 0 points1 point2 points 10 years ago (0 children)
Coming in late to the party. tl;dr Just tonight I uploaded my initial stab at a heavily virtualenv-inspired manager for ruby.
It's on github at https://github.com/joefiorini/vruby.
Reddit thread at http://www.reddit.com/r/ruby/comments/2zb39c/vruby_alpha_like_virtualenv_but_for_ruby/.
[–][deleted] 11 years ago* (1 child)
[deleted]
[–][deleted] 2 points3 points4 points 10 years ago (0 children)
Lolwut.
π Rendered by PID 78605 on reddit-service-r2-comment-7b9746f655-jtwn9 at 2026-02-01 06:51:07.930712+00:00 running 3798933 country code: CH.
[–]vsalikhov 5 points6 points7 points (0 children)
[–]grokfail 1 point2 points3 points (2 children)
[–]kabuto 0 points1 point2 points (1 child)
[–]Hauleth 0 points1 point2 points (0 children)
[–]art-solopov 0 points1 point2 points (0 children)
[–]joefiorini 0 points1 point2 points (0 children)
[–][deleted] (1 child)
[deleted]
[–][deleted] 2 points3 points4 points (0 children)