INSTALL RUBY
1. Install rbenv
$ git clone https://github.com/rbenv/rbenv.git ~/.rbenv
$ echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
$ echo 'eval "$(rbenv init -)"' >> ~/.bashrc
$ source ~/.bashrc
2. Install ruby-build
$ mkdir -p "$(rbenv root)"/plugins
$ git clone https://github.com/rbenv/ruby-build.git "$(rbenv root)"/plugins/ruby-build
3. Install the required packages
$ sudo apt -y update && sudo apt -y upgrade
Ubuntu 20.04.3 LTS \n \l
$ sudo apt-get install -y gcc make autoconf bison build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm6 libgdbm-dev libdb-dev
$ sudo apt-get install -y gcc make autoconf bison build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm5 libgdbm-dev libdb-dev
4. Install Ruby using rbenv (it may take 30 minutes to 1 hour to complete depending on the Internet environment).
$ rbenv install 3.0.1
When trying to install Ruby 3.0.1, the following error may occur.
$ rbenv install 3.0.1
ruby-build: definition not found: 3.0.1
See all available versions with `rbenv install --list'.
If the version you need is missing, try upgrading ruby-build:
git -C /home/user_name/.rbenv/plugins/ruby-build pull
In this case, you should run the command as instructed (the/home/user_namepart will vary depending on your environment, so replace it accordingly).
$ git -C /home/user_name/.rbenv/plugins/ruby-build pull
After completing the above process, let's install Ruby 3.0.1 again.
$ rbenv install 3.0.1
5. Specify the version of Ruby to be used as standard
$ rbenv global 3.0.1
6. Check the Ruby version
ruby 3.0.1p64 (2021-04-05 revision 0fb782ee38) [x86_64-linux]
INSTALL BUNDLER
$ bundler -v
Bundler version 2.2.26
INSTALL PostgreSQL
$ sudo apt -y install postgresql libpq-dev
psql (PostgreSQL) 12.6 (Ubuntu 12.6-0ubuntu0.20.04.1)
INSTALL SQLite
$ sudo apt install sqlite3 libsqlite3-dev
3.31.1 2020-01-27 19:55:54 3bfa9cc97da10598521b342961df8f5f68c7388fa117345eeb516eaa837balt1
INSTALL RAILS
$ gem install -v 6.0.3 rails
Rails 6.0.3
Node.js initial Settings