105 How to find out your current Rails LTS version

Updated . Posted . Visible to the public.

Rails 3.2 LTS, 4.2 LTS, 5.2 LTS

Run the following command:

bundle show rails

This will display the path of the installed rails gem. The path will contain the version number, e.g. 3.2.22.8 below:

/home/alice/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/rails-3.2.22.8
                                                                 ^^^^^^^^

Rails LTS 2.3

Installation with bundler

As a customer of a paid plan who has installed Rails LTS with Bundler, run the following:

bundle show rails

This will display the path of the installed rails gem. The path will contain the version number, e.g. 2.3.18.18 below:

/home/alice/.rbenv/versions/1.8.7-p375/lib/ruby/gems/1.8/gems/rails-2.3.18.19
                                                              ^^^^^^^^^^^^^^^

Installation without bundler

As a customer of a paid plan who has installed Rails LTS without Bundler, run the following:

gem list | grep rails

Community edition

As a subscriber to the free Community edition, run the following:

# on 2.3
$ script/runner 'puts RailsLts::VERSION.to_s' # say "script/runner -e production ..." on production

# on 3.2
$ rails runner 'puts RailsLts::VERSION.to_s' #say "script/runner -e production ..." on production

That command will not work on older versions since RailsLts::VERSION did not exist back then. You will encounter an error like this:

.../gems/railslts-bcf87a3aad2b/activesupport/lib/active_support/dependencies.rb:469:in `load_missing_constant': uninitialized constant RailsLts (NameError)

In such cases you can be confident that you are not on the most recent version and should update to the latest release now.

Arne Hartherz
Last edit
Tobias Kraze
License
Source code in this card is licensed under the MIT License.
Posted by Arne Hartherz to Rails LTS documentation (2014-01-31 18:14)