First, we should update “apt-get” using the command below: Gems are packages that extend the functionality of Ruby, we would want to install Rails through Gem.
On Debian 9 (stretch), it is Ruby 1.8.7 patchlevel 302 (and below, possibly above, including ruby enterprise edition) have a known compiler bug, however compiling Ruby will finish without errors.
The bug will cause a segmentation fault whenever an SSL connection is opened, like .../timeout.rb:60: [BUG] Segmentation fault.
You can test that everything is installed and working properly entering the new project folder and running the built-in development server that comes with Rails.
Getting up and running with Rails on Debian Stretch is fairly easy.
Either way, Stretch makes a great Rails development platform.
I tried following the advice here — Install ruby 2.2.3 via apt, but unfortunately I get the error, “alternative path /usr/bin/ruby2.2 doesn't exist”.RVM provides a ton of options, but requires some work to set up.Debian has everything you need in its repositories, but they limit the control you have over your development environment.In this tutorial we recommend that you use Ruby Version Manager (RVM) for this purpose.RVM is a tool for installing and managing multiple Ruby versions. through yum, apt-get, source tarball, rbenv and chruby.The openssl extension of Ruby version before 2.4 is not compatible with Open SSL 1.1.x.