How to set up one Ruby version with the cPanel Ruby Selector?

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.
Was this answer helpful?

Related Articles

How to install Ruby Gems?

To install gems we can use the gem command-line program. Log in to your Hostginger hosting...

How to use the Interactive Ruby Shell to troubleshoot gems?

To start interactive Ruby Shell, type at the command prompt: irbAt the irb prompt, type the...

How to set up multiple Ruby versions with the cPanel Ruby Selector?

Log in to cPanel account. If you are using the Jupiter theme, click Setup Ruby App under...