Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

rvm and rbenv on the same machine

I traditionally have used rbenv for all my personal projects on my personal laptop without issue and like it. However I need to start working with a codebase (rails) at work and we use rvm on all our work laptops. Is there any way to get rvm and rbenv to live happily together or should I be able to bootstrap the app without rvm and just use rbenv to manage the local ruby for this repo?

like image 418
nulltek Avatar asked Mar 04 '16 23:03

nulltek


People also ask

What is the difference between RVM and RBenv?

RVM includes a built-in Ruby installation mechanism while Rbenv does not. Rbenv main sell point is that its lightweight in comparison with RVM, while still providing just enough functionality for the Ruby development.

What is RBenv and how do I use it?

There are basic Rbenv commands that you are going to use at some point of Ruby development: rbenv install <version> installs given Ruby version, rbenv global <version> sets the default system Ruby version, rbenv version displays the currently used Ruby version of your system,

What is the best alternative to RVM?

The other known option is called rbenv. It’s a much more simpler and reliable solution, and it does not mess the system up, keeping everything local and manageable. RVM and its downsides

What version of Ruby does RVM use?

rvm use default <version> sets the Ruby version that your system uses by default The last two commands are useful to remember whenever you start the development of a new Ruby-written program. In most cases, it's best to use the latest stable version, which is always installable via the rvm install ruby --latest command.


1 Answers

You can't really have rbenv and rvm coexist. With rvm, it overrides the 'gem' command, so that would make rbenv useless.

If you want to use rbenv for both, you'd have to avoid using gemsets and instead use bundler to handle dependencies. But it seems like rvm is a hard constraint, so perhaps move personal work to rvm.

like image 67
Stephen Grimes Avatar answered Sep 29 '22 06:09

Stephen Grimes