How to install Ruby on Ubuntu?

In the last few days I have been a bit busy with the development of a project for <°DesdeLinux (that's why my absence: P), I am developing this project in Ruby on Rails.

Unfortunately some distributions do not come with Ruby installed by default and the version that appears in the repositories is already somewhat "old". Those who have tried to do it manually will understand that such an installation is something «complex and cumbersome«, So this time I will show you how to install correctly Ruby and RubyGems in Ubuntu and its derivatives in a fairly simple way :). I don't know if this can work for Debian too, so if anyone dares to try, welcome;). In other distributions, I think it would only be a matter of looking for a similar or homologous package.

After browsing the web and trying several ways to do it correctly (without success :(), I found in a blog a small script that allows to do it more or less well, since at the end of the installation it threw me some small errors and a few warnings, so I took on the task of solving those potholes and made some pertinent corrections :). I must clarify that I only included some packages that are indispensable for Ruby;).

Well, without further ado, here is the modified script:

http://paste.desdelinux.net/4393

As you can see, it is quite simple. Here the important point of the script would be to choose the version of Ruby that you want to install, by default it will install the most recent version to date, but if you like to use another version, you only have to modify the following line:

Version="1.9.3-p125"

for the version you want to install, it should be noted that you only need to enter the version number for the script to work correctly;). Just rename the file to: install_ruby

The way to execute it would be:

sudo ./install_ruby

I hope it can be useful to you, do not stop commenting and remember: happy coding 😉

Source: dopefish.de


Leave a Comment

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

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.

  1.   dwarf said

    Ok, wait. Which project?

  2.   Merlin The Debianite said

    Ok give me a little time and I'll let you know if it works on debian.

    I am not a programmer and I don't think it will be of much use to me, it is simple curiosity to see if your script works and by the way it does have flaws, I have no idea or even bother to check. XD

  3.   dwarf said

    troll on mode: Ruby is the language of hipsters! xD

    1.    perseus said

      [mode troll on] Sure bro, just like it appears here:

      http://www.youtube.com/watch?v=PLUS00QrYWw

      XDDDDDDDDDD

      [/ mode troll off]

      XDDDDDDDD

      1.    Manual of the Source said

        Correct your user agent, the "Kubuntu Firefox" distribution does not exist. 😛

        1.    gilber1988 said

          in the kubuntu terminal "apt-get install firefox",
          now it exists !!!

  4.   elip89 said

    Excellent script perseus unfortunately I don't use Ubuntu to test it: S Ruby and Python are the languages ​​I would like to learn. Any recommendation???

    1.    perseus said

      For Ruby, there are excellent Ebooks, but unfortunately the best are in English, if this does not inhibit you, you can read: Beginning Ruby From Novice to Professional Second Edition (Peter Cooper) - Apress. Despite being in this language, English is quite legible and understandable, one of the best I've seen;).

      As for python, there is a lot of information on the web and a lot of it in our language :).

      If you need a ruby ​​link, let me know and I'll send it to you ^. ^

      1.    elip89 said

        Thanks for the recommendation perseus I'll download it and try to read it even though I know more or less English 😀

        regards

  5.   Juan Antonio said

    To install ruby ​​I use rvm ( https://rvm.io/ )

    It allows to have different versions of ruby ​​installed and to create sets of gems.

    It's very, very good.

  6.   Merlin the Debianite said

    Yes it works in debian but it only works in terminal.

    XD

  7.   Felix said

    to give you execute permissions
    sudo chmod + x scriptname ...
    it didn't work for me without that ...