Getting Started with Ruby on Rails on Webdock
Last updated: July 19th 2023
Introduction
Ruby on Rails is a popular application stack for developers looking to create sites and web apps. The Ruby programming language combined with the Rails development framework allows for the building and deployment of scalable apps quickly.
Webdock makes it easy to get started with Rails on your server, and in this guide, I will show you how to get started with Ruby on Rails on your Webdock server. Let’s go.
Prerequisites
- An Ubuntu Server (on Ubuntu Jammy in my case)
- A Sudo user
- Coffee or Beverage of choice (it will take some time ;) )
Installing Node.js
Node.js provides a runtime platform for executing JavaScript code on the server side. This makes it possible to write web application server-side scripts in JavaScript. To install Node.js to your server:
List all updates:
$ sudo apt update
Just to make sure curl is installed:
$ sudo apt install curl
Run the below command to add NodeJS 18 repo.
$ curl -sL https://deb.nodesource.com/setup_18.x | sudo -E bash -
Install NodeJS:
$ sudo apt-get install nodejs -y
You can learn how to daemonize your Node.js application, among other handy tips, here.
Installing dependencies
Ruby relies on several packages that you can install through your package manager. Once those are installed, you can install rbenv and use it to install Ruby.
First, update your package list:
$ sudo apt update
Then install the dependencies:
$ sudo apt install git libssl-dev libreadline-dev zlib1g-dev autoconf bison build-essential libyaml-dev libreadline-dev libncurses5-dev libffi-dev libgdbm-dev
To install rbenv, first install the dependencies, then use curl to fetch the install script from GitHub and pipe it directly to bash to run the installer:
$ curl -fsSL https://github.com/rbenv/rbenv-installer/raw/HEAD/bin/rbenv-installer | bash
Next, ensure the rbenv command line utility is in your $PATH. You can do this by editing your ~/.bashrc file. This will make sure that the changes take effect the next time you log in:
$ echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
Then, add the command eval "$(rbenv init -)" to your ~/.bashrc file so rbenv loads automatically:
$ echo 'eval "$(rbenv init -)"' >> ~/.bashrc
Next, apply the changes you made to your ~/.bashrc file to your current shell session:
$ source ~/.bashrc
Run the type command to check if rbenv is set up and working as it should:
$ type rbenv
The output should be something like this:
Installing Ruby
The ruby-build plugin makes installing different versions of Ruby with a single easy command easy. To see a list of all available versions of Ruby, type the following command:
$ rbenv install -l
I will choose version 3.2.1:
$ rbenv install 3.2.1
Installing Ruby can take some time, so make sure you have a beverage of your choice handy to help pass the time.
Once you've installed Ruby, you can set it as your default version with the global sub-command. This will ensure that all new projects use the correct version of Ruby from the start:
$ rbenv global 3.2.1
To check if Ruby was correctly installed, find out its version number:
$ ruby -v
Installing Rails
I am going to install Rails using Gems. Ruby libraries are distributed as gems, and you use the gem command to manage these gems.
But, Installing a gem comes with the generation of local documentation. If you want to save time, you can disable this setting:
$ echo "gem: --no-document" > ~/.gemrc
Once this is done, install Bundler:
$ gem install bundler
Then, install Rails:
$ gem install rails
You can also use the -v flag to install a specific version:
$ gem install rails -v 7.0.4.2
Now that you've got Ruby on Rails installed, it's time to start developing web applications! To test your installation, create a new project and see if everything works as expected. Check the Ruby on Rails documentation for troubleshooting tips if you encounter any problems.
Conclusion
In this article, I successfully deployed Ruby on Rails on a Webdock server.
Aayush Nair has been designing WordPress websites for eight years now. He is also a content writer, writing blogs on technology and related topics, and likes helping people in his free time.
Related articles
-
How to install OpenLiteSpeed on Webdock
In this article we show you how you can install the OpenLiteSpeed web server on Ubuntu Jammy.
-
How to Deploy your First Node.js Application on your Ubuntu Web Server
-
How to set up WireGuard on your Webdock Server
This article details how you can quickly and easily install WireGuard on your Webdock Server.
-
How to set up OpenVPN on your Webdock Server
This article details how you can quickly and easily set up a VPN on your Webdock server.
-
How to Install and configure aaPanel on Ubuntu
-
How to install azuracast on Webdock
This guide shows you how to work around certain issues when installing azuracast on Webdock.
-
How to set up Runcloud on Webdock
-
How to set up cPanel on Webdock
-
How to set up Gridpane on Webdock
-
How to set up Ploi on Webdock
This article details the steps you need to go through in order to install Ploi on a Webdock server.
-
How to set up Laravel Forge on Webdock
-
How to set up Plesk on Webdock
This article details the steps you need to go through in order to install Plesk on a Webdock server.
-
How to set up Cyberpanel on Webdock
-
How to set up SpinupWP on Webdock
-
How to set up DirectAdmin on Webdock
-
How to set up Hestia on Webdock
-
How to set up Virtualmin on Webdock
-
How to install and create pipelines in Jenkins
-
Basic WordPress site setup with aaPanel
In this guide, we will install and setup a basic WordPress site with aaPanel.
-
How to use Nginx as reverse proxy and secure connections with SSL certificates
Using Nginx to proxy pass your site with SSL security.
-
Setting up monitoring with Netdata on your Webdock server
-
How to Setup Python Web Application With Flask Gunicorn and Nginx
A simple Python Flask web app hosting with Gunicorn and Nginx
-
How to Daemonize an Application with Systemd
Using systemd to autostart your application on system startup.
-
Set-up New Relic Monitoring on Your Webdock Server
This guide provides step-by-step instructions to install New Relic to monitor your VPS.
-
How to Install VaultWarden on Your Webdock Server
-
How to Install the Latest Version of HTOP on Ubuntu Server
Instructions to install latest htop package on your Ubuntu server
-
How to Install ImageMagick 7 on Ubuntu LEMP/LAMP stacks
Simple instructions to install ImageMagick 7 along with the PHP extension
-
A Quick Guide to Installing Rust on Ubuntu
-
How To Install Proxmox on Your Webdock Server
This article provides instructions on how to install Proxmox on your Webdock server
-
How To Run Nextcloud on Your Webdock Ubuntu Server
Instructions to Install Nextcloud on your server with Docker
-
The Ultimate Guide to Setting Up Mastodon server
A detailed guide with instructions to set up Mastodon on your Webdock server
-
A Guide To Setting Up Mindustry Game Server on Ubuntu
Step-by-step instructions to set up your own Mindustry server
-
A Guide to Installing ERPNext on Your Webdock Server
Step-by-step instructions to install ERPNext - a resource planning software - on your server
-
A Beginner's Guide to Installing Apache Kafka on Ubuntu
Detailed instructions to get Kakfa running on Ubuntu!
-
A Quick Guide To Installing Rocket Chat on Ubuntu
Instructions to install Rocket Chat on your Ubuntu server
-
How to Install Ghost CMS on a Webdock Server
Easily install Ghost CMS on your Webdock server with these instructions!
-
How to Install cPanel on a Webdock Ubuntu Server
Instructions for setting up cPanel on an Ubuntu server