How do I create a Ruby app w/ PostgreSQL

Hey,

new to the Ruby world, I was following a tutorial that uses Sqlite3, and I already have PostgreSQL installed on my machine. My question is how can I set up PostgreSQL with Ruby via terminal.

There is a gem named pg. Try to install it with gem install pg.

It is a wrapper around libpq (the PostgreSQL library).

In a system as Ubuntu, with postgres installed, you could add what is needed to compile it with:

apt install libpq-dev

pg README has examples of how to use it.

1 Like