Could not install Ruby 2.3.4 in Ubuntu 17.04 using RVM

I could not install Ruby 2.3.4 which I needed because Heroku does not support latest stable release like 2.4.0.  So my Gemfile has locked the version 2.3.4. Till now I have been manually commenting out that particular line from the Gemfile and skipping the change from Git-Commits.

Hack

I found a hack

  • install ruby 2.3 from apt-get
sudo apt-get install ruby2.3 ruby2.3-dev
  • find location of the ruby installed
which ruby2.3
# => /usr/bin/ruby2.3
  • Mount the ruby to RVM
rvm mount /usr/bin/ruby2.3 -n ruby-2.3.3

rvm list                                

rvm rubies

 * ext-ruby-2.3.3 [ x86_64 ]
   ruby-1.8.7-p371 [ x86_64 ]
   ruby-1.9.3-p551 [ x86_64 ]
=> ruby-2.4.0 [ x86_64 ]

A better option

Install Ruby from archived link

rvm mount -r https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.3.tar.bz2
Advertisements