Building a Linux Server for Ruby on Rails Development

This course covers how to build a server or virtual server for Ruby on Rails Development using Fedora, Ubuntu, or CentOS Linux.
Course info
Rating
(61)
Level
Intermediate
Updated
Oct 1, 2014
Duration
2h 30m
Table of contents
Introduction
Installing Virtual Box
Installing Fedora or CentOS Linux
Ubuntu Linux
CentOS
Basic Services: SSH, Apache, vsftpd, Git
Installing SQLite, MySQL, and PostgreSQL
Ruby and RVM
Install Ruby on Rails
Summary
Description
Course info
Rating
(61)
Level
Intermediate
Updated
Oct 1, 2014
Duration
2h 30m
Description

Build a server or virtual server for Ruby on Rails Development. In this course, we will use Fedora, Ubuntu, or CentOS Linux to set up a server. Virtual Box will be used to create virtual servers. We will install and configure SSHD, vsftpd, Apache, MySQL, SQLite, and PostgreSQL. We will install multiple versions of Ruby using RVM, and we will install Ruby on Rails 4.1. We will then build a simple project to test our server, and then create a clone image that can be used for future projects. If you follow along, at the end you will have a server ready for Ruby on Rails development.

About the author
About the author

Jim Pickrell teaches at Los Angeles City College and is president of Brand X Internet, a local internet service in Santa Monica. He studied at the University of Washington, UCLA, and the Technical University of Munich. He programs in C, C++, Ruby on Rails, Objective C, Perl, Fortran, Java, Javascript, and Assembler.

Section Introduction Transcripts
Section Introduction Transcripts

Installing Virtual Box
In this module I'm going to show you how to download, install, and manage Virtual Box, our virtual server software. After we install Virtual Box, we will use it to install Linux.

Installing Fedora or CentOS Linux
In this section I'm going to show you how to download and install Fedora Linux. Fedora is the free version of Red Hat, a commercial Linux. I've been using Fedora Linux for many years. For those who use CentOS, it's the same thing, they've taken fedora and they've just removed the branding. You can install on either a virtual server or on a real server. The installation process is pretty much the same either way. I'm also going to give out some information about CentOS, but it's basically the same as Fedora.

Ubuntu Linux
In this section we will install Ubuntu Linux on our virtual server. This is an alternative to Fedora or CentOS. All of them are popular; the choice is up to you.

CentOS
In this section I'm going to show you how to download and install CentOS. CentOS is one of the most popular flavors of Linux. I've used CentOS for a number of projects on the Amazon Cloud and it worked out really great. CentOS and Fedora are both derived from Red Hat. Red Hat is open source and it's free, so the folks from CentOS just download Red Hat and repackage it and release it as CentOS. Most anything that works on Fedora will work exactly the same on CentOS. The installation is a little different, so in this module we will show you how to download and install CentOS. Because of the similarities between CentOS and Fedora, I'm going to keep this section fairly short. If you have problems, you may want to refer to the section on Fedora, but this section should get you started.

Basic Services: SSH, Apache, vsftpd, Git
In this section we're going to install and configure some basic services on our server. These are programs you should have on any server, no matter what kind of programming or development you are doing. We will install SSHD, client and server, for secure shell access to the server so that we can remotely log in via the text interface. We will install Apache HTTPD, the standard web server that is probably the most popular web server on the internet today, certainly the most popular on Linux servers. We will install VSFTPD, the very secure FTP server, which will allow us to upload and download files from the server. This is a replacement for FTPD, the standard FTP server. We will install Git, a version control software that will allow us to track changes and share work with others on our development projects. All of these are fairly standard programs. They're free downloads from the internet. Let's get started.

Installing SQLite, MySQL, and PostgreSQL
We are going to install three databases, SQLite, MySQL, and PostgreSQL. All of them can be used with Ruby on Rails. All of them are easy to install, so it's up to you to choose which one you like. After installing each of the databases, we'll do a quick test to make sure that they work. It's very important that we know that our databases are working or we'll have all kinds of problems getting our Ruby on Rails projects to work (Loading).

Ruby and RVM
In this module we're going to install the Ruby programming language and RVM, a package manager for Ruby. Ruby is an object oriented programming language that was written by Yukihiro Matsumoto. It is usually interpreted and it is the basis for the Ruby on Rails framework. Ruby is open source and cross platform. A Ruby program written on a Linux computer will often work on Mac or Windows without any modification at all. It's a great language and very easy to learn. RVM is the Ruby Version Manager, which allows multiple versions of Ruby to coexist. In this module, first we will install Ruby standalone, then we'll go back and do it over again. We will install Ruby 1. 9. 3 and Ruby version 2. 1. 1 using RVM. You won't often have two versions of Ruby on a single project, but you might find yourself working on two different projects that require different versions of Ruby. This will be our recommended way to install Ruby and Ruby on Rails.

Install Ruby on Rails
Our server is almost done. We have our basic tool installed, the SQL database is installed, Ruby is installed with RVM. The next thing on our list is Rails.

Summary
In this course we have built an entire server for Ruby on Rails development from scratch. We installed Virtual Box, the virtual server software. This allows us to create virtual servers running Linux in a little window on our Windows or Mac computer. Then we downloaded Linux and installed it. We set up our server without X Windows, because we don't need any windowing and it slows the server down. We set up the networking and we set up port forwarding so that our server can reach the network. We installed Joe, the editor, and Lynx, a text-based web browser. We configured SSHD, VSFTPD, and the Apache Web Server. We installed three SQL servers, SQLite, MySQL, and PostgreSQL. Then we installed Ruby and Ruby on Rails. Finally, we created a very simple project to verify that Ruby on Rails is actually working. After testing everything, we saved a disk image that we can use a starting point for future projects. With this, our course is complete. If you have completed this course successfully, you might want to look at all the other great Pluralsight courses on Ruby and Ruby and Rails. Ruby is a great system and Linux is the best system to support it. My name is Jim Pickrell. I hope this course will help you get up and going right away with your Linux-based server. Thanks again and see you next time.