Older posts:

Install the latest version of Ruby 3, Rails 7, and Postgresql

rvm list
rvm get head
rvm install ruby-3.0.3
rvm --default use 3.0.3

gem install rails -v 7.0.0

gem update bundler
gem update rails
gem update --system
sudo apt update

sudo apt install postgresql libpq-dev redis-server redis-tools

ruby -v
rails -v
bundler -v
pg_config --version

Next Step - install Postgresql


Bonus: using Rails main in Gemfile

gem 'rails', git: 'https://github.com/rails/rails.git'
# or
# gem 'rails', github: 'rails/rails'