View
Posted almost 4 years ago. Visible to the public.

How to find out your current Rails LTS version

Rails LTS 3.2

Run the following command:

Copy
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:

Copy
/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:

Copy
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:

Copy
/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:

Copy
gem list | grep rails

Community edition

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

Copy
# 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:

Copy
.../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.

Author of this card:

Avatar
Arne Hartherz
Last edit:
14 days ago
by Henning Koch
13 cards