Ruby

Ruby on Rails install

Installation of Ruby on Rails framework for backend web development with MySQL database.

Shell

Install Gems

gem install rails && gem install mysql2

Creeate a Ruby on Rails application

rails new myApp -d mysql

Create a new controller. Ex: ApiController

cd myApp && bin/rails generate controller Api index

Edit app database configuration

vim config/database.yml

Launch localhost server

bin/rails server

Plesk Config

Configuration for passenger config in Plesk

ServerName mydomain.net
DocumentRoot /var/www/vhosts/mydomain.net/public

PassengerMaxPoolSize 15
PassengerPoolIdleTime 10                           
PassengerMinInstances 3
PassengerRuby /usr/local/rvm/gems/ruby-2.3.1/wrappers/ruby

<Directory /var/www/vhosts/mydomain.net/public>
	Allow from all
	Options -MultiViews
</Directory>

secrets.yml

Execute this command in production server for configure secret_key_base

rake secret