Instalando RoR en Linux

Vía Hackers News llego a un artículo para principiantes de cómo (y cómo no) instalar Ruby on Rails (RoR) en un entorno Linux. A continación pego el artículo, con una discusión interesante, tanto en HN como en el propio blog:

Most of us use some Linux distro or Mac OS X with Rails – Windows Rails users seem to be a very small community.

Every now and then, on the #rubyonrails IRC channel, some confused guy comes in, and has absolutely no idea why some of his code won’t work (from some tutorial, usually) and ruby keeps giving him odd error messages.

Usually, the first question anyone asks is “what operating system are you on?”; invariably, its some kind of Linux distro, and the next question asked is “how’d you install ruby/rails?”

Usually, the answer is “apt-get” or “aptitude” for ruby, and then gem for rails (or, in worse cases, “apt-get” for everything).

Let’s get this down right now; THIS IS THE WRONG WAY OF DOING THINGS.

Nearly all the repositories have old versions of ruby (and even older versions of rails), and they have all kinds of configuration chinks. You cannot work like that. Instead, you have to use RVM, which is quite possibly the best thing since sliced bread.

RVM manages your rubies for you so that you don’t end up with version differences killing your productivity.

Installation is done via the awesome new “pipe into sh” route:

curl -L get.rvm.io | bash -s stable 

Load it:

source ~/.rvm/scripts/'rvm' 

If you want to use version 1.9.3, just go ahead and:

rvm use 1.9.3 

Want to test with 1.9.2? Sure:

rvm use 1.9.2 

Commands like gem also work right out of the box:

gem install rails 

That’s it. You’re done. You no longer have to deal with the frustration that arises from using distro-built ruby packages.

DISCLAIMER:

These instructions may or may not work by the time you’re reading this; it was published on 4/28/12, so, consider that before you reference this tutorial when asking for help.

One thought on “Instalando RoR en Linux

  1. hola acabo de enterarme de tu pagina y la verdad es que me parece excelente no sabia de mas personas interesadas en estos temas, aqui tienes un nuevo lector que seguira visitandote quincenalmente.

Leave a Reply

Your email address will not be published. Required fields are marked *