Installing Ruby on Rails on Debian 11
This guide describes how to install Ruby on Rails on Debian 11.
We will do everything through the console in a few steps.
First, we install the necessary packages:
1 | apt-get install gnupg2 curl wget -y |
We add the key to the system:
1 2 | gpg2 --keyserver hkp://pool.sks-keyservers.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB curl -sSL https://rvm.io/pkuczynski.asc | gpg2 --import - |
We download the RVM script
1 | curl -sSL https://get.rvm.io | bash -s stable --ruby |
We link in the system:
1 | source /usr/local/rvm/scripts/rvm |
We can check the RVM version by issuing the command:
1 | rvm version |
the result of the:
1 | rvm 1.29.12 (latest) by Michal Papis, Piotr Kuczynski, Wayne E. Seguin [https://rvm.io] |
We update rvm to the latest version by issuing a command:
1 | rvm get stable --autolibs=enable |
We give permission
1 | usermod -a -G rvm root |
We install Ruby:
1 | rvm install ruby-3.0.2 |
We set the default version:
1 | rvm --default use ruby-3.0.2 |
Installation of Nodejs and Yarn
We install the necessary packages:
1 | apt-get install gcc g++ make -y |
We download the script:
1 | curl -sL https://deb.nodesource.com/setup_14.x | bash - |
We add a Yarn repo to the system:
1 2 | curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list |
We install nodejs and yarn:
1 | apt-get update |
1 | apt-get install nodejs yarn -y |
We are updating Gem packages:
1 | gem update --system |
The last step is to install rails with the command:
1 | gem install rails -v 6.1.4 |