
In the previous command, the postgresql package holds the main PostgreSQL program, while postgresql-contrib adds several PostgreSQL features that extend its capabilities. sudo apt install postgresql postgresql-contrib libpq-dev.Next, install PostgreSQL and its development libraries: Using sudo privileges, update your APT package index to make sure that your repositories are up to date: In order to configure Ruby on Rails to create your web application with PostgreSQL as a database, you will first install the database onto your server. This tutorial will use version 2.6.3 of Ruby and 5.2.3 of Rails for information on the latest versions, check out the official sites for Ruby and Rails.
LIBRARY RAILS HOW TO
To set this up, follow our guide on How to Install Ruby on Rails with rbenv on Ubuntu 18.04. PrerequisitesĪn Ubuntu 18.04 server set up by following the Initial Server Setup Guide for Ubuntu 18.04, including a non-root user with sudo privileges and a firewall.Ī Ruby on Rails development environment installed on your Ubuntu 18.04 server. You will install and configure PostgreSQL, and then test your setup by creating a Rails application that uses PostgreSQL as its database server. In this tutorial, you will set up a Ruby on Rails development environment connected to a PostgreSQL database on an Ubuntu 18.04 server. In order to configure your Ruby on Rails setup to use PostgreSQL, you will need to perform a few additional steps to get it up and running. However, for highly complex applications that need more reliable data integrity and programmatic extensibility, a PostgreSQL database will be a more robust and flexible choice. SQLite is a lightweight, portable, and user-friendly relational database that performs especially well in low-memory environments, and will work well in many cases. When using the Ruby on Rails web framework, your application is set up by default to use SQLite as a database.
