Log into your Hostginger hosting account.
Check the available Ruby versions. Type the following command.
ls /opt/alt | grep ruby
Select a version as per your choice.
Create a directory to store installed local gems.
Edit the file .bash_profile as following:
RUBYHOME="/opt/alt/ruby version" ORIG_GEM_HOME=$("$RUBYHOME/bin/gem" --config-file "" env GEM_HOME) GEM_HOME="$HOME/ruby" GEM_PATH="$GEM_HOME:$ORIG_GEM_HOME" GEM_SPEC_CACHE="$GEM_HOME/specs" PATH="$RUBYHOME/bin:$PATH" export RUBYHOME export GEM_HOME export GEM_PATH export GEM_SPEC_CACHE export PATH
Put the exact value on the bold written area.
Update the modification with the command:
source .bash_profile
Check the installation with the command: ruby -v; If ruby is installed properly it will show the version.