{{announcement.body}}
{{announcement.title}}

Developing and Deploying Ruby on Rails With PostgresDB on The Cloud [Video]

DZone 's Guide to

Developing and Deploying Ruby on Rails With PostgresDB on The Cloud [Video]

A split text and video tutorial offering steps on how to develop a Ruby on Rails application with PostgresDB on the cloud with Azure App Service.

· Cloud Zone ·
Free Resource

Ruby

Developing Ruby on Rails application using PostgresDB

In this post, you will learn how to develop a Ruby on Rails web app with PostgresDB on Azure App Service. Ruby on Rails Demo

Ruby on Rails demo

This post will provide a walk-through tutorial this includes Ruby on Rails installation and configuration, Postgres local server installation and configuration, web application development, and many other steps.

You will see how to install all the prerequisites, run the application on the local Ruby on Rails server with the local Postgres server, then develop new features and push that to the cloud using Git commands.

Here are the main steps and code.

You may also enjoy: Getting the Most out of Your Database with Ruby on Rails

Steps and Code   

Connect to Local Postgres Server

Open the terminal window and run  psql  to connect to your local Postgres server.

Shell




xxxxxxxxxx
1


 
1
sudo -u postgres psql
2
sudo -u postgres createuser mradwan


 

Clone the Sample Application to The Local Directory from GitHub

Run the following command to clone the sample repository.

Ruby




xxxxxxxxxx
1
13
9


 
1
git clone https://github.com/Azure-Samples/rubyrails-tasks.git
2
cd to your cloned directory. Install the required packages.
3
cd rubyrails-tasks
4
bundle install --path vendor/bundle
5
rake db:create
6
rake db:migrate
7
rails server


Azure Cloud Shell

To run the code in Azure Cloud Shell, start the Cloud Shell and select the Copy button on a code block to copy the code. Paste the code into the Cloud Shell session. Select Enter to run the code.

Create a Resource Group

Shell




xxxxxxxxxx
1


 
1
az group create --name RGLabRadwan --location "West Europe"


Create a Postgres server on Azure.

Shell




xxxxxxxxxx
1


 
1
az postgres server create --location "West Europe" --resource-group myResourceGroup --name <postgres-server-name> --admin-user mradwan --admin-password mypassword --sku-name GP_Gen4_2



See the rest of the steps in the video:

Further Reading

When Ruby on Rails Is Not a Good Fit

Essential PostgreSQL [Refcard]

Topics:
ruby on rails ,postgres ,azure ,postgresdb ,tutorial ,azure app service ,cloud

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}