Ruby on rails

Ruby on Rails

Ruby on Rails (simplified as Rails) is a server-side web application framework written in Ruby under the MIT License. Rails is a model–view–controller (MVC) framework, providing default structures for a database, a web service, and web pages. It encourages and facilitates the use of web standards such as JSON or XML for data transfer and HTML, CSS and JavaScript for user interfacing. In addition to MVC, Rails emphasizes the use of other well-known software engineering patterns and paradigms, including convention over configuration (CoC), don't repeat yourself (DRY), and the active record pattern.

Ruby on Rails' emergence in 2005 greatly influenced web app development, through innovative features such as seamless database table creations, migrations, and scaffolding of views to enable rapid application development. Ruby on Rails' influence on other web frameworks remains apparent today, with many frameworks in other languages borrowing its ideas, including Django in Python; Catalyst in Perl; Laravel, CakePHP and Yii in PHP; Grails in Groovy; Phoenix in Elixir; Play in Scala; and Sails.js in Node.js.

Well-known sites that use Ruby on Rails include Airbnb, Crunchbase, Dribbble, GitHub, Twitch and Shopify.

See Ruby on Rails on Wikipedia.

Getting started

The Pro Linux Container of Brap is pre-configured with Ruby on Rails.

To check which version of Rails is installed, run:

rails --version

To create a new Rails application, run:

rails new blog

To run the Rails application, start up the web server:

bin/rails server

To run the Rails application:

rails server

To run the Rails application and make it accessible from the internet, run:

rails server -b 0.0.0.0

Ruby on Rails in VS Code and the web browser

Screenshot: Ruby on Rails in VS Code and the web browser

Manage Rails Versions

To list available versions of Rails, run:

gem search '^rails$' --all

To install a version of Rails, run:

gem install rails -v 4.2.7

rbenv rehash

ruby -c

Keywords

  • ruby
  • ruby on rails
  • rails
  • web
  • framework
  • mvc
  • backend
  • frontend
  • fullstack

Back to top