37 ms·
If you run the right interpreter (e.g., ruby-2.1), it will know what paths to load gems and libraries from. So that's not the problem. As others mention, scrip
by lobster_johnson 11y ago
If you run the right interpreter (e.g., ruby-2.1), it will know what paths to load gems and libraries from. So that's not the problem.
As others mention, scripts typically just run "ruby" (via shebang or directly), which will pick whatever is the default.
Debian/Ubuntu have the "alternatives" system, which is designed to solve this for any kind of program, but it's virtually impossible to use by humans; there's no single command to switch between versions.
Fortunately, the ruby-switch package [1] wraps the terrible UI in a single command to switch versions. I highly recommend it.
Of course, this switches the version globally. To get per-shell Ruby versions, you will need the other tools mentioned in this thread.
[1] https://wiki.debian.org/Ruby https://wiki.debian.org/Ruby