Install Specific Version of Ruby with `apt-get install ruby-full ruby-dev`

8,830

You didn't mentioned which version of Ubuntu you are using, anyway based on the version of ruby you are getting: 2.3 I guess you are running xenial or something newer that of that.

If you search for the package you are looking for at Ubuntu Packages, you will see that your desired version 1.9.3 only exist in trusty; so you simply can't install or downgrade it from 2.3 to 1.9.3 because it does not exist in any of your running Ubuntu repositories.

So what you can do is installing it from a third party PPA, the closest thing to your desired version which I found is Brightbox Ruby PPA, they have compiled 1.9.1 for all available Ubuntu versions from lucid to yakkety; They have a source package for zesty but they didn't compile it yet.

Share:
8,830

Related videos on Youtube

David West
Author by

David West

I love ruby

Updated on September 18, 2022

Comments

  • David West
    David West over 1 year

    When I execute apt-get install ruby-full ruby-dev I am getting ruby 2.3. I want ruby 1.9.3.

    How do I get it to install ruby 1.9.3?

    I'm using Ubuntu 16.0.4 Xenial.

    • David Foerster
      David Foerster about 7 years
      I'm voting to reopen the question because there's no Ruby v1.9.* shipped through Xenial's repositories as far as I can tell. A better duplicate would be How to find and install latest Ruby version using RVM? whose accepted answer can be used to install any Ruby version.
    • David West
      David West about 7 years
      instead of using apt-get for provisioning the ruby install I think I'll use RVM
    • Victor Pudeyev
      Victor Pudeyev almost 6 years
      use a ruby version manager, such as rbenv.