Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Benefits of RVM

Tags:

ruby

rvm

Why should I/should I not use RVM?

I'm new to the ruby language and servers as a whole. I've had some trouble installing using RVM...so I'm inclined to not use it right now, but it seems like it may make installations down the road easier?

I'm interested to hear about your experience with RVM and your thoughts as it pertains to maintaining a server.

like image 430
Kevin Brown Avatar asked Jun 22 '11 13:06

Kevin Brown


3 Answers

RVM is useful even if you don't want to install multiple versions at the same time. I'm a ruby hobbyist (PHP during the day :(), and I have no reason to want to use old versions, but I still use RVM.

Installing ruby is a pain. Getting it from the package manager (at least in ubuntu) gives you an outdated version that changes installation directories from the defaults. I've had nothing but problems with it.

So you think, "I'll just build it from source". Building from source requires getting a load of dependencies and configuring options. Often times I've built ruby only to find out I forgot to enable SSL support or readline support.

RVM takes care of all of this. In 3 or so commands, you have a perfectly built version of ruby.

And I didn't even cover how RVM manages multiple ruby installations for you, which is its killer feature. If you have that need, there is really no other sane solution.

like image 133
ryeguy Avatar answered Nov 18 '22 15:11

ryeguy


RVM is great as this allows your to install different versions without touching your system's default Ruby install. It is rather similar to virtualenv's in Python.

Another great advantage to having RVM are the gemsets - you can create as many gemsets that are unique to the version, and patch level, of ruby.

I've extolled some of its virtues here and you should also see this blog post.

In terms of maintaining a server - let's take a Passenger install for example; do remember that Passenger is installed as a gem, so with rvm the benefit here is that you can have multiple installs of passenger, tied to a different version of ruby. Of course, typically, you'll have Passenger running on one version at a time, although there are ways to have Passenger, in particular, running on different ruby versions.

like image 45
Michael De Silva Avatar answered Nov 18 '22 15:11

Michael De Silva


I use different Ruby versions for different projects (that's where .rvmrc is really handy). Some deployment environments are happy with 1.9, while there are a couple of legacy servers using 1.8 for some reasons. Also, occasionally I want to launch a specific version of ruby to compare how they work. RVM does all that for me.

like image 1
Evgeny Shadchnev Avatar answered Nov 18 '22 13:11

Evgeny Shadchnev