rails

Ruby on Rails Installation Tutorial Using Linux VPS

Understanding Ruby on Rails (RoR) will help if you are familiar with the framework before delving deeper into RoR. A framework is a structure designed to simplify the process of developing web applications. The default structure for web pages, databases, and code is provided by the framework. The framework can be simplified by comparing it to a Lego toy, where you can mix and match different Lego pieces to create anything you want. Web application development can be completed faster and more effectively by utilizing RoR.

Ruby on Rails (RoR)

RoR is a Ruby programming language framework. The fact that RoR is a “full stack” framework is one of its unique selling points. Because of this feature, RoR can be used to generate HTML and update pages directly, including front-end elements, in addition to managing back-end elements such as databases and servers.

RoR builds web applications using Model View Controller (MVC) architecture. MVC architecture will separate the web application code into three parts, namely:

rails

– Model: focuses on the server side and deals with databases or data structures.

– Appearance: focuses on the aesthetics of the web application while serving the user.

– Controller: connects the Model and View and includes the logic for the web application.

How to Install Ruby on Rails on Linux VPS

install ruby on rails
  1. Choose a VPS Hosting Package: Choose a VPS provider that suits your needs, make sure they provide a choice of Linux operating systems that are compatible with RoR.
  2. Change VPS Operating System: Log in to the VPS control panel and change the operating system to a Linux distribution supported by RoR, such as Ubuntu or CentOS.
  3. VPS SSH Login and Server Update: Access the VPS via Secure Shell (SSH) and perform a system update using the sudo apt update (for Ubuntu distribution) or sudo yum update (for CentOS distribution) commands.
  4. Install Dependency Linux: Pasang dependensi Linux yang diperlukan untuk menginstal dan menjalankan Ruby on Rails dengan perintah sudo apt install curl gnupg2 dirmngr libssl-dev libreadline-dev zlib1g-dev autoconf bison build-essential libyaml-dev libreadline-dev libncurses5-dev libffi-dev libgdbm-dev.
  5. Install Node.js and Yarn: Ruby on Rails requires Node.js and Yarn to run some frontend features. Install both with the appropriate commands for your Linux distribution.
  6. Install Rbenv Ruby Version Manager: Rbenv is a Ruby version management tool that allows you to install and use different Ruby versions on one system. Follow the instructions to install Rbenv on its official GitHub page.
  7. Install Ruby Programming Language: After installing Rbenv, we can install the desired Ruby version with the command rbenv install [versi_ruby]. Make sure to set the newly installed Ruby version as the default version with the command rbenv global [versi_ruby].
  8. Install RoR Framework: Finally, install the RoR framework with the gem install rails command.
  9. Create a New Rails Project: Create a new project by running the rails new command. [nama_proyek]. Ini akan membuat struktur dasar untuk proyek web kita.
  10. Run Rails Project on Server: Move to our project directory and start the Rails development server with the rails server command. Open a browser and visit the VPS IP address with the port specified by the Rails development server (usually http://alamat_ip_vps:3000).

You can quickly launch a RoR-based website on VPS Indonesia by following the previous procedure. For web development, RoR offers a powerful and effective framework, and VPS Indonesia provides a reliable and scalable hosting environment that makes your web application function perfectly.

Bagikan ini:

Leave a Reply

Your email address will not be published. Required fields are marked *