The Python Oracle

Ruby equivalent of virtualenv?

--------------------------------------------------
Rise to the top 3% as a developer or hire one of them at Toptal: https://topt.al/25cXVn
--------------------------------------------------

Music by Eric Matyas
https://www.soundimage.org
Track title: Over a Mysterious Island Looping

--

Chapters
00:00 Ruby Equivalent Of Virtualenv?
00:34 Accepted Answer Score 99
00:47 Answer 2 Score 82
01:12 Answer 3 Score 27
01:40 Answer 4 Score 19
01:56 Answer 5 Score 18
02:02 Thank you

--

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

--

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.