You may have noticed that I'm making an effort to do more Rubinius-related stuff today (Friday, 05 August 2011) because it's rbx day. I've been doing stuff with Rubinius off-and-on anyway, ever since first giving Rubinius a try, but this is a great excuse to start doing more.
One thing I have not done that I decided to do today is start using the Ruby Version Manager, or RVM, making this RVM Day as well as RBX Day. I installed RVM for the first time, and am now trying to get used to using it. So far, it's pretty slick.
The downside so far is that it is not very clearly explained anywhere -- and not just it, but the Ruby installation options that come with it. I don't recall where, but I saw an example somewhere that suggested using rvm install ruby-head for some reason, but I do not recall it saying anything about why rbx-head rather than rbx, for instance. I imagine rbx-head must give me up-to-date rbx from the current state of the Rubinius project, but beyond that my guesswork does not provide me much in the way of specifics.
I have not yet found a single point where one can go to get a quick start with RVM that provides understanding as well as examples, thus resulting in my choices being either by-rote cargo cult installation and use or hours of sifting through help documentation and pestering people in email or IRC for details.
I know that RVM's popular use is a relatively recent thing, and of course I grant some leeway for that fact; people have likely just not had time to bring the quality of tutorial documentation up to par with the needs of new users of RVM, and it is totally understandable. I am just pointing out where that deficiency exists. Unfortunately, I am still so much a novice with RVM that I am not qualified to fill in the gaps in documentation.
Before you start just blindly following my examples below, I recommend you actually read the whole thing, and check out the linked pages. I know this is kind of a lot of reading, but this is not in fact a fully cleaned up tutorial, ready for prime time. It is more of a rambling explanation of my experiences getting started with RVM, including explanations that might be of help to other people just getting started. If you have a better (more succinct) source of information than this, you should use it -- and you should tell me about it. I have a contact page here at blogstrapping you can use to tell me about any tutorials and explanations you've found.
If I do not find something suitable before I get around to it, I may write up a complete startup tutorial at some point when I feel sufficiently well educated about all the relevancies of RVM to do so. For now, though, this is what you get from me.
The -s is "silent mode" for the curl command. Curl itself is basically a download tool (though a fair bit more, as well). By issuing that parenthesized curl command, you are effectively telling it "give me the file at the indicated URI, and don't tell me any details". Obviously, the -s can be omitted if you want more information about what is going on. If I am not mistaken in my assumption, the redirects before the opening parenthesis basically tell your shell that instead of saving the file somewhere, it should send its contents to bash for execution. This makes me wonder if it would work with other shells than bash, such as sh, but I have not investigated the matter.
Also, I already have Git installed, so that part seemed unnecessary. As such, I just ran the command using curl to install RVM, and used this rvm install command. Unfortunately, it did not work as advertised.
What else can you do? The output of rvm help is a gigantic wall of text that can be a little difficult to wade through. Spend hours on it?
Well, I suppose I could have done that as the next step in my own odyssey of learning about RVM, but it would be nice if there was something a little quicker and easier to give me a boost. In fact, the situation is worsened a bit by the fact that rvm rbx does something surprising, in that it fails to start an instance of irb, the Ruby REPL, when run without a program name argument. This is surprising because via other means I have used to install Rubinius just executing rbx with no arguments would start the REPL. In addition, while managing various different Ruby versions simultaneously with a centralized system like RVM would hopefully make things easier for admin purposes, I am not really sure this is a huge win when every time I need to run a program I need to prepend the rvm command to the command I would otherwise use.
Setup current shell to use a specific ruby version.
Within that shell, but not others, RVM establishes the indicated rbx install as the Ruby implementation that should be used every time I enter a ruby or irb command. Other shells will use whatever is the system default, but that one uses what I have just told it to use. This is, in fact, pretty slick.
So far, so good. I just wish there had been a nicely formatted page somewhere obvious explaining all of this, plus the information I still do not know about what has gone before, in a clear and helpful manner. At least trial and error, in the cases where I have used that approach to muddle through so far, has not resulted in screwing up something on my system yet (as far as I'm aware).
Perhaps, once I get some more experience and understanding with this stuff, I'll flesh out and clean up this explanation for an RVM tutorial page. Then, maybe I'll try providing it to the people maintaining RVM so they can put it somewhere obvious enough that people like me who come along in the future can gain the benefit of my experience.