How to install postgresql ,pg ruby gem , trestle admin on fedora 26

I used this link

https://erawanu.wordpress.com/2017/08/18/install-postgresql-on-fedora-26-workstation/

I had to use sudo with the commands.

To connect to postgres I use below command :
sudo -u postgres psql postgres

Then, I install library with below command:

yum install libpqxx-devel

and then install pg gem with below

gem install pg

Now , follow the instructions on and clone below project:

Before DB setup — you first need to create a role in postgres and also add it to database.yml in config folder of your rails app.

Now , create a new role in postgres as below:

create role karan with createdb login password 'password1';

now add the role in database.yml inside the config folder as below:

default: &default
adapter: postgresql
encoding: unicode
# For details on connection pooling, see Rails configuration guide
# http://guides.rubyonrails.org/configuring.html#database-pooling
pool: <%= ENV.fetch(“RAILS_MAX_THREADS”) { 5 } %>
username: karan
password: password1

Now , just start your rails server with below command:

rails server

Programmer and Entrepreneur.

Programmer and Entrepreneur.