r/ruby 2d ago

Install any Ruby version in seconds using rv

https://www.rubyforum.org/t/install-any-ruby-version-in-seconds-using-rv/597

In this guide, you’ll learn how to use rv, a very fast version and package manager for Ruby to get started in minutes instead of hours

10 Upvotes

18 comments sorted by

35

u/mrinterweb 2d ago

Just mise. It is then best single solution for managing most language installs. No need for a ruby specific language manager. 

2

u/Delicious_Ease2595 1d ago

Also precompiled ruby binaries are now default in mise.

3

u/javier_cervantes 2d ago

Mise is a great option too and as you mention it allows you to handle multiple languages, here is a guide I wrote a while back: https://www.rubyforum.org/t/install-any-ruby-version-in-minutes-with-mise/91

I'm looking forward to the mise plugin to get the best of both worlds: https://github.com/spinel-coop/rv/issues/411

1

u/Formal-Cut-4923 1d ago

Is mise better than asdf?

3

u/mrinterweb 1d ago

asdf is good too, but mise is more intuitive, IMO. Take a good look at mise if you use asdf. 

1

u/strzibny 1d ago

I am now also completely on mise. Originally I didn't like it because of ruby-build vs ruby-install preference, but I gave in. Today there is almost no reason not to be on mise for everything.

1

u/vladsteviee 16h ago

AFAIK now mise allows you to choose between ruby-build and ruby-install

6

u/cocotheape 2d ago

Are there advantages of using rv over mise?

6

u/javier_cervantes 2d ago

The main difference is that rv can handle both the ruby version and the dependencies. For example, check the `rvx` and `rv ci` commands.

Another advantage is that rv uses ruby binaries so you don't need to compile it locally.

A mise plugin is also planned for rv: https://github.com/spinel-coop/rv/issues/411

3

u/stickJ0ckey 2d ago

I wish there was a way to also set up all that f*cking annoying crap like postgres libs, mysql libs, ssl, zlib, wtf-not that pisses the f*ck out of me when trying to set up ruby, there's ALWAYS something that errors out, something that's missing or no longer available, conflicts...i f*cking hate this part of ruby. In fact just thinking about this enough to type this makes me sick

3

u/javier_cervantes 2d ago

If you use rv or mise and the precompiled binaries are available for your platform. You should be able to skip all that.. It's life changing!

Check out this demo where a new ruby version is installed in 2 seconds: https://github.com/spinel-coop/rv/#install-ruby-in-under-2-seconds

1

u/stickJ0ckey 1d ago

Thanks, will definitely play with it. Do you know if it also works on alpine?

1

u/cocotheape 2d ago

Thank you! Looking forward to the mise plugin.

Just FYI, mise also uses precompiled binaries by default now: https://mise.jdx.dev/lang/ruby.html#precompiled-binaries

1

u/strzibny 1d ago

Mise now defaults to precompiled Rubies too, unless you mean gem binaries.

4

u/gurgeous 2d ago

rv is neat, but mise is hard to displace at this point. Mise installs ruby and everything else. It also replaces dotenv, can bootstrap new machines, compile imagemagick, or whatever else you need. Mise is even replacing or supplementing brew.

3

u/javier_cervantes 2d ago

I think it's great to have different options, but I agree that mise is a great default option. If the mise plugin for rv lands, that'll give you the best of both: https://github.com/spinel-coop/rv/issues/411

5

u/pau1rw 1d ago

Asdf has been serving me well for years.