The Python Oracle

Ruby equivalent of virtualenv?

Become part of the top 3% of the developers by applying to Toptal https://topt.al/25cXVn

--

Music by Eric Matyas
https://www.soundimage.org
Track title: Flying Over Ancient Lands

--

Chapters
00:00 Question
00:56 Accepted answer (Score 98)
01:13 Answer 2 (Score 84)
01:43 Answer 3 (Score 25)
02:22 Answer 4 (Score 18)
02:45 Thank you

--

Full question
https://stackoverflow.com/questions/4869...

Question links:
[virtualenv]: http://pypi.python.org/pypi/virtualenv

Accepted answer links:
[RVM]: http://rvm.io/

Answer 2 links:
[bundler]: http://bundler.io/rationale.html
[Gemfile]: http://bundler.io/v1.5/gemfile.html

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#python #ruby #virtualenv

#avk47



ACCEPTED ANSWER

Score 99


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




ANSWER 2

Score 83


Neither sandbox, RVM, nor rbenv manage the versions of your app's gem dependencies. The tool for that is bundler.

  • use a Gemfile as your application's dependency declaration
  • use bundle install to install explicit versions of these dependencies into an isolated location
  • use bundle exec to run your application



ANSWER 3

Score 27


I'll mention the way I do this with Bundler (which I use with RVM - RVM to manage the rubies and a default set of global gems, Bundler to handle project specific gems)

bundler install --binstubs --path vendor

Running this command in the root of a project will install the gems listed from your Gemfile, put the libs in ./vendor, and any executables in ./bin and all requires (if you use bundle console or the Bundler requires) will reference these exes and libs.




ANSWER 4

Score 18


No one seems to have mentioned rbenv.