Commit ddcf21ea498bb1ca5f4d1e3d5a06a61e575a62cc
1 parent
5639825e
Exists in
master
and in
1 other branch
incompatible ruby version error
Some users are reporting errors due to incompatible ruby versions. This commit aims to provide users with a helpful error message so they can more easily spot the issue.
Showing
1 changed file
with
8 additions
and
0 deletions
Show diff stats
Gemfile
... | ... | @@ -4,6 +4,14 @@ RAILS_VERSION = '~> 4.2.0' |
4 | 4 | |
5 | 5 | send :ruby, ENV['GEMFILE_RUBY_VERSION'] if ENV['GEMFILE_RUBY_VERSION'] |
6 | 6 | |
7 | +detected_ruby_version = Gem::Version.new(RUBY_VERSION.dup) | |
8 | +required_ruby_version = Gem::Version.new('2.1.0') # minimum supported version | |
9 | + | |
10 | +if detected_ruby_version < required_ruby_version | |
11 | + fail RuntimeError, "RUBY_VERSION must be at least #{required_ruby_version}" \ | |
12 | + ", detected RUBY_VERSION #{RUBY_VERSION}" | |
13 | +end | |
14 | + | |
7 | 15 | gem 'actionmailer', RAILS_VERSION |
8 | 16 | gem 'actionpack', RAILS_VERSION |
9 | 17 | gem 'railties', RAILS_VERSION | ... | ... |