Latest in branch 5.0
5.0.7.2
Released 13 Mar 2019
(7 years ago)
SoftwareRuby on Rails
Version5.0
Status
End of life
Initial release5.0.0
30 Jun 2016
(9 years ago)
Latest release5.0.7.2
13 Mar 2019
(7 years ago)
End of bug fixes09 Apr 2018
(Ended 8 years, 1 month ago)
End of security fixes09 Apr 2018
(Ended 8 years, 1 month ago)
Release noteshttps://github.com/rails/rails/releases/tag/v5.0.7.2
Source codehttps://github.com/rails/rails/tree/v5.0.7.2
Downloadhttps://github.com/rails/rails/releases/tag/v5.0.7.2
Ruby on Rails 5.0 ReleasesView full list

What Is New in Ruby on Rails 5.0

CategoryHighlights
New FeaturesAction Cable for WebSockets, API-only application mode, Active Record attributes API, built-in test runner.
ImprovementsBin scripts (rails test, rails restart, rails dev:cache), evented file watcher enabled by default, HSTS headers, STDOUT logging option, Spring config, new README.md generation.
Breaking ChangesRemoved debugger gem (use byebug), removed deprecated test tasks, removed Rack::ContentLength from default stack, ActionDispatch::ParamsParser removed, ActionController::Parameters no longer inherits from HashWithIndifferentAccess.
Deprecationsconfig.static_cache_control, config.serve_static_files, *_filter callbacks, respond_to/respond_with, redirect_to :back, ActionController::Parameters constants, many ActiveRecord callbacks and methods.

How does Action Cable enable real-time features in Rails 5?

Action Cable integrates WebSockets directly into the Rails stack, letting you write real-time channels in pure Ruby.

  • Server-side channels inherit from ApplicationCable::Channel and have full access to Active Record models.
  • Client-side JavaScript uses a built-in consumer that connects to /cable automatically.
  • Scalable deployment works with any Rack-compatible server; you can run multiple workers behind a Redis pub/sub backend.
# app/channels/chat_channel.rb
class ChatChannel < ApplicationCable::Channel
  def subscribed
    stream_from "chat_#{params[:room]}"
  end

  def receive(data)
    ActionCable.server.broadcast("chat_#{params[:room]}", data)
  end
end

What is the API-only mode and how do I generate an API-only Rails app?

Rails 5 can generate a lean stack that omits view-related middleware, helpers, and assets, perfect for JSON APIs.

  • Run rails new my_api --api to create the skeleton.
  • The generated ApplicationController inherits from ActionController::API, not ActionController::Base.
  • Middleware such as ActionDispatch::Cookies and Rack::MethodOverride are excluded by default.
  • Generators skip views, helpers, and assets unless you explicitly add them back.
# config/application.rb
module MyApi
  class Application < Rails::Application
    config.api_only = true
  end
end

How does the new Active Record attributes API change type casting and defaults?

The attributes API lets you declare typed attributes, custom defaults, and even virtual columns without database backing.

  • Use attribute :price_in_cents, :integer to override the default decimal type.
  • Supply a default value or a proc: attribute :published_at, :datetime, default: -> { Time.current }.
  • Define virtual attributes that are serialized/deserialized automatically, e.g., attribute :tags, :string, array: true.
  • Custom types can be created by subclassing ActiveModel::Type::Value and implementing cast and serialize.
# app/models/product.rb
class Product < ApplicationRecord
  attribute :price_in_cents, :integer
  attribute :status, :string, default: "draft"
end

product = Product.new(price_in_cents: "1999")
product.price_in_cents # => 1999

What are the key deprecations and removals that can break existing apps when upgrading to Rails 5?

Several long-standing APIs were removed or deprecated, and they will raise errors if your code still relies on them.

  • Debugger support was dropped; replace debugger with the byebug gem.
  • respond_to and respond_with were extracted to the responders gem.
  • Deprecated *_filter callbacks; migrate to *_action equivalents.
  • Old redirect_to :back is gone; use redirect_back fallback_location: root_path.
  • ActionDispatch::ParamsParser was removed from the middleware stack; configure parsers via ActionDispatch::Request.parameter_parsers=.

How does the new test runner improve the developer workflow?

The built-in test runner invoked with bin/rails test adds flexible options and better output for Minitest suites.

  • Run a single test by appending :line_number (e.g., bin/rails test test/models/user_test.rb:42).
  • Use -f for fail-fast, -d to defer output, -b for full backtraces, and -v for verbose mode.
  • Colored output makes failures stand out in the terminal.
  • Integration with Minitest options like -n (run by name) and -s (seed) is seamless.
# Run all tests with verbose output and fail fast
bin/rails test -v -f

Frequently Asked Questions

Does Rails 5 require Ruby 2.2 or higher?
Yes Rails 5 drops support for Ruby versions older than 2.2.

How do I generate an API-only application with Rails 5?
Run rails new my_api --api to create a slimmed-down API app.

Can I still use the old respond_to/respond_with helpers in Rails 5?
No they have been removed and are now provided by the responders gem.

What command runs the new Rails 5 test runner?
Use bin/rails test to execute your test suite.

How do I enable per-form CSRF tokens introduced in Rails 5?
Set config.action_controller.per_form_csrf_tokens = true in your environment configuration.

Releases In Branch 5.0

VersionRelease date
5.0.7.213 Mar 2019
(7 years ago)
5.0.7.127 Nov 2018
(7 years ago)
5.0.729 Mar 2018
(8 years ago)
5.0.608 Sep 2017
(8 years ago)
5.0.6.rc124 Aug 2017
(8 years ago)
5.0.531 Jul 2017
(8 years ago)
5.0.5.rc225 Jul 2017
(8 years ago)
5.0.5.rc119 Jul 2017
(8 years ago)
5.0.419 Jun 2017
(8 years ago)
5.0.4.rc114 Jun 2017
(8 years ago)
5.0.312 May 2017
(9 years ago)
5.0.201 Mar 2017
(9 years ago)
5.0.2.rc124 Feb 2017
(9 years ago)
5.0.121 Dec 2016
(9 years ago)
5.0.1.rc210 Dec 2016
(9 years ago)
5.0.1.rc101 Dec 2016
(9 years ago)
5.0.0.110 Aug 2016
(9 years ago)
5.0.030 Jun 2016
(9 years ago)
5.0.0.rc222 Jun 2016
(9 years ago)
5.0.0.rc106 May 2016
(10 years ago)
5.0.0.beta427 Apr 2016
(10 years ago)
5.0.0.beta324 Feb 2016
(10 years ago)
5.0.0.beta201 Feb 2016
(10 years ago)
5.0.0.beta1.125 Jan 2016
(10 years ago)
5.0.0.beta118 Dec 2015
(10 years ago)