Welcome to Rails

What's Rails


Understanding the MVC pattern is key to understanding Rails. MVC divides your application into three layers: Model, View, and Controller, each with a specific responsibility.

Model layer


Controller layer


View layer


Frameworks and libraries

Active Record, Active Model, Action Pack, and Action View can each be used independently outside Rails. In addition to that, Rails also comes with Action Mailer, a library to generate and send emails; Action Mailbox, a library to receive emails within a Rails application; Active Job, a framework for declaring jobs and making them run on a variety of queueing backends; Action Cable, a framework to integrate WebSockets with a Rails application; Active Storage, a library to attach cloud and local files to Rails applications; Action Text, a library to handle rich text content; and Active Support, a collection of utility classes and standard library extensions that are useful for Rails, and may also be used independently outside Rails.

Getting Started


    $ gem install rails

    $ rails new myapp

    where “myapp” is the application name.

  3. Change directory to myapp and start the web server:

    $ cd myapp
    $ rails server

    Run with --help or -h for options.

  4. Go to http://localhost:3000 and you'll see: “Yay! You’re on Rails!”




Trying to report a possible security vulnerability in Rails? Please check out our security policy for guidelines about how to proceed.

Everyone interacting in Rails and its sub-projects' codebases, issue trackers, chat rooms, and mailing lists is expected to follow the Rails code of conduct.


Ruby on Rails is released under the MIT License.