103 Installing Rails 6.1 LTS

Posted . Visible to the public.

This document describes how to swap out the official Rails 6.1 gems with Rails 6.1 LTS. If you have installed Rails LTS before and want to update to a newer version, please see our update instructions.

Prerequisites

  1. Subscribe to a Rails LTS plan to receive your credentials. If you already have a paid subscription for another version of Rails LTS, you can use the same credentials for Rails 6.1 LTS at no additional cost.

  2. Make sure your project satisfies the system requirement for Rails LTS. This involves upgrading to the latest official Rails 6.1 release.

Installation

  1. Open the Bundler configuration file (Gemfile) in your project's root directory and find this line:

    gem 'rails'
    

    Replace that line with the following code:

    source 'https://username:password@gems.railslts.com' do
     gem 'rails', '~> 6.1.7'
     gem 'activesupport', require: false
     gem 'activemodel', require: false
     gem 'activerecord', require: false
     gem 'actionview', require: false
     gem 'actionpack', require: false
     gem 'activejob', require: false
     gem 'actionmailer', require: false
     gem 'actioncable', require: false
     gem 'activestorage', require: false
     gem 'actionmailbox', require: false
     gem 'actiontext', require: false
     gem 'railties', require: false
     gem 'railslts-version', require: false
     gem 'rack', require: false
    end
    

    Replace username and password with your personal credentials that you received after subscribing to Rails LTS.
    Make sure a colon (:) separates username and password.

    If you don't want these credentials in your Gemfile, you can either

    • set them in an environment variable BUNDLE_GEMS__RAILSLTS__COM=username:password.
    • use bundle config set gems.railslts.com username:password

    In this case, just use source 'https://gems.railslts.com'.

    Note that our repositories are available via SSL (https) only, http://... will not work.

  2. Run Bundler to complete the installation:

    bundle update rails
    

    You might get a lot of unrelated upgrades. If you want to get as few updates as necessary, you can instead try to use this:

    bundle update activesupport activemodel activerecord actionview actionpack activejob actionmailer actioncable activestorage actionmailbox actiontext railties rack --conservative
    
  3. Confirm that you are running the latest version of Rails 6.1 LTS.

  4. Follow your normal release process (run tests, push, deploy to staging, do smoke/whatever testing, deploy to production).

Congratulations! You successfully deployed your application using Rails LTS.

If you have chosen to subscribe to the Rails LTS Notification List when signing up, you will be notified whenever a new patch for Rails LTS becomes available.

Note on rails-ujs or jquery-ujs

  • In case your app still uses the old jquery-ujs Javascript integration, please see the installation instructions for our fork of jquery-ujs.
  • If your application uses @rails/ujs, you can keep using the official release (version 6.1.7-8).

Breaking changes

  • There are currently no breaking changes.
Tobias Kraze
Last edit
Tobias Kraze
License
Source code in this card is licensed under the MIT License.
Posted by Tobias Kraze to Rails LTS documentation (2024-09-18 09:55)