Install Ruby 2.3

Hi people, any body knows how to install Ruby 2.3? I have tried with rvm and rbenv unsuccessfully.


$ ruby --version
ruby 2.6.5p114 (2019-10-01 revision 67812) [x86_64-linux-gnu]

is fine too, you can install it with:

sudo swupd bundle-add ruby-basic

Thanks for the answer. But no, it is not fine. When you work in rails, you need the same ruby version as the server in production, this is because you need to have the same gem set. I need at least ruby 2.3.8.
I like very much Clear Linux, but it is not useful to work, because at the moment I can not install the working development environment. By the other hand, RVM can not recognize swudp as a package manager and BTW, I could not find a way to install old versions for packages like ruby, postgresql, openssl and so on. In other distros the package manager lets me to do that.

Clear Linux OS is very different and does not offer(*) older versions of packages. This is done to reduce the risk that you are running insecure software. Keeping older versions patched and secured against vulnerabilities is very costly, and we don’t have the resources to support it.

(*) There are a few exceptions - in case upstream makes a good effort to provide patches to older versions


Compiling Ruby — Source Code

Installing from the source code is a great solution for when you are comfortable enough with your platform and perhaps need specific settings for your environment. It’s also a good solution in the event that there are no other premade packages for your platform.

See the Installation page for details on building Ruby from source. If you have an issue compiling Ruby, consider using one of the third party tools mentioned above. They may help you.* *

Not maintained anymore (EOL):*

  • Ruby 2.4.10
    sha256: 93d06711795bfb76dbe7e765e82cdff3ddf9d82eff2a1f24dead9bb506eaf2d0
  • Ruby 2.3.8
    sha256: b5016d61440e939045d4e22979e04708ed6c8e1c52e7edb2553cf40b73c59abf

in the download page of ruby

but isn’t the best solution to migrate the server ?


I am also a Rails developer working on Clear Linux. I run rbenv installed to my home directory, and can confirm it’ll fail to install Ruby 2.3.8:

pete@marvel ~ $ rbenv -v
rbenv 1.1.2-28-gc2cfbd1
pete@marvel ~ $ which rbenv
pete@marvel ~ $ ruby -v 
ruby 2.6.6p146 (2020-03-31 revision 67876) [x86_64-linux-gnu]
pete@marvel ~ $ rbenv install 2.3.8
Downloading ruby-2.3.8.tar.bz2...
Installing ruby-2.3.8...

WARNING: ruby-2.3.8 is past its end of life and is now unsupported.
It no longer receives bug fixes or critical security updates.

BUILD FAILED (Clear Linux OS 33060 using ruby-build 20200401-7-g637ddf3)

Inspect or clean up the working tree at /tmp/ruby-build.20200509130524.4243.zOVSFX
Results logged to /tmp/ruby-build.20200509130524.4243.log

Last 10 log lines:
linking shared-object
make[2]: Leaving directory '/tmp/ruby-build.20200509130524.4243.zOVSFX/ruby-2.3.8/ext/bigdecimal'
linking shared-object
make[2]: Leaving directory '/tmp/ruby-build.20200509130524.4243.zOVSFX/ruby-2.3.8/ext/nkf'
linking shared-object
make[2]: Leaving directory '/tmp/ruby-build.20200509130524.4243.zOVSFX/ruby-2.3.8/ext/date'
linking shared-object
make[2]: Leaving directory '/tmp/ruby-build.20200509130524.4243.zOVSFX/ruby-2.3.8/ext/ripper'
make[1]: Leaving directory '/tmp/ruby-build.20200509130524.4243.zOVSFX/ruby-2.3.8'
make: *** [ build-ext] Error 2

Ignoring for a moment the fact that Ruby 2.3.8 is past end-of-life and therefore no longer receiving security updates, you can develop against this old version of ruby using docker.

This command is successful and I can start a Ruby 2.3.8 container just fine:

docker pull ruby:2.3.8

As a consultant, I have found it’s the best strategy for developing against the many many heterogenous configurations of Rails apps out there. Since your server machine is most definitely not running Clear Linux, you’d be doing yourself a favor to pull a docker image for the exact operating system it’s running, since any OS level quirks will be replicated to your development environment. (no more “but It works on MY machine!”)

To take advantage of this, you’ll want to: swupd bundle-add containers-basic

You’ll find that Clear Linux is a dynamite host machine for client docker images.

Hope this helps – I know it’s not exactly how you wanted it to work, but it’s the best way to use old and now-unsupported versions of Ruby and of Rails.

The tools he tried using: rvm and rbenv both will compile from source. The issue he’s hitting must be that the libraries he needs to link against are no longer compatible. See my other answer for compiler output.

You are not wrong, though: the best answer is to migrate the server to a newer, more secure version of ruby. Lots of clients / companies don’t want to pay for that work (to their detriment, IMO). When I can’t convince them, I use docker.

1 Like

For the moment we can not migrate the server. We hope that at the end of this year we can upgrade the rails version and off course, the ruby version.
I’ve tried to compile ruby 2.3.8 directly from the source, but it needs the package openssl 1.0, and that was another stone in the shoe. To be honest, after one hour to be trying I surrendered.

Hi friend, a lot of thanks for you answer, I appreciate it very much. I had not thought in this solution. To be honest I’m not an expert using docker, but I think that it’s a great opportunity to learn more about it. I’m going to try this solution this weekend. Have a nice day.