Ruby
-
How To Build a Ruby on Rails Application
Introduction Rails is a web application framework written in Ruby. It takes an opinionated approach to application development, assuming that set conventions best serve developers where there is a common goal. Rails therefore offers conventions for handling routing, stateful data, asset management, and more to provide the baseline functionality that most web applications need. Rails follows the model-view-controller (MCV) architectural pattern, which separates an application’s logic, located in models, from the routing and presentation of application information. This organizational structure…
-
How To Set Up Ruby on Rails with Postgres
Status: Deprecated This article is deprecated and no longer maintained. Reason We now provide up to date tutorials for using Rails with Postgres that are tailored to individual platforms. See Instead This article may still be useful as a reference, but may not work or follow best practices. We strongly recommend using a recent article written for the operating system you are using. How To Use PostgreSQL with Your Ruby on Rails Application on Ubuntu 18.04 How To Use PostgreSQL…
-
A Comparison of Ruby Version Managers for macOS
In this article, I’ll compare the most popular version managers for Ruby on a Mac: Chruby, Rbenv, and RVM, as well as Asdf, a version manager for multiple languages, and Frum, a brand new version manager written in Rust. I’ll make recommendations based on what you’re most likely to need. Pre-installed Ruby is Not for Developers Folks who are new to Ruby are delighted to discover that Ruby comes pre-installed on macOS. They’re often disappointed when a more experienced developer…
-
How To Automate Ruby On Rails Application Deployments Using Capistrano
Introduction If you are not already fed up with repeating the same mundane tasks to update your application servers to get your project online, you probably will be eventually The joy you feel whilst developing your project tends to take a usual hit when it comes to the boring bits of system administration (e.g. uploading your codebase, amending configurations, executing commands over and over again, etc.) But do not fear! Capistrano, the task-automation-tool, is here to help. In this DigitalOcean…
-
How To Create Nested Resources for a Ruby on Rails Application
Introduction Ruby on Rails is a web application framework written in Ruby that offers developers an opinionated approach to application development. Working with Rails gives developers: Conventions for handling things like routing, stateful data, and asset management. A firm grounding in the model-view-controller (MCV) architectural pattern, which separates an application’s logic, located in models, from the presentation and routing of application information. As you add complexity to your Rails applications, you will likely work with multiple models, which represent your…
-
How To Set Up User Authentication with Devise in a Rails 7 Application
The author selected Girls Who Code to receive a donation as part of the Write for DOnations program. Introduction The Devise gem is an authentication solution for Ruby on Rails applications; it helps you set up production-ready user authentication in your projects without having to do everything on your own. Devise provides many useful features such as handling user sessions and adding support for third-party sign-in with OAuth using the OmniAuth gem. Devise also comes with built-in modules for functionalities…
-
How To Use PostgreSQL with Your Ruby on Rails Application on Ubuntu 20.04
Introduction When using the Ruby on Rails web framework, your application will use SQLite as a database by default. SQLite is a lightweight, portable, and user-friendly relational database that performs especially well in low-memory environments, so it will work well in many cases. However, for highly complex applications that need more reliable data integrity and programmatic extensibility, a PostgreSQL database will be a more robust and flexible choice. You will need to perform additional steps to configure your Ruby on…
-
How To Set Up a Ruby on Rails v7 Project with a React Frontend on Ubuntu 20.04
The author selected the Electronic Frontier Foundation to receive a donation as part of the Write for DOnations program. Introduction Ruby on Rails is a popular server-side web application framework. It powers many popular applications that exist on the web today, like GitHub, Basecamp, SoundCloud, Airbnb, and Twitch. With its emphasis on programmer experience and the passionate community built around it, Ruby on Rails will give you the tools you need to build and maintain your modern web application. React…
-
How To Install Ruby on Rails with rbenv on macOS
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, makes app development quick and efficient. One way to install Ruby and Rails is with the command-line tool rbenv. Using rbenv will provide you with a well-controlled and robust environment for developing your Ruby on Rails applications, allowing you to easily switch your working version of Ruby as needed. rbenv provides support…