aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
diff options
context:
space:
mode:
authorArthur Nogueira Neves <github@arthurnn.com>2015-03-05 08:53:31 -0500
committerArthur Nogueira Neves <github@arthurnn.com>2015-03-05 08:53:31 -0500
commit3c94bdd05506c1f276b866255312d945a1edc039 (patch)
tree30f51bdd56380aaa4b1bda00d0f68efe5f607941 /activesupport
parentd969405acd98a6e6b39391e45fc3803fd3f26d32 (diff)
parentf81d80a3a47630604fb9c8aecdf90c93a45a0426 (diff)
downloadrails-3c94bdd05506c1f276b866255312d945a1edc039.tar.gz
rails-3c94bdd05506c1f276b866255312d945a1edc039.tar.bz2
rails-3c94bdd05506c1f276b866255312d945a1edc039.zip
Merge pull request #19180 from sivsushruth/master
If TZInfo-data is not present in windows, let the user know.
Diffstat (limited to 'activesupport')
-rw-r--r--activesupport/lib/active_support/railtie.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/railtie.rb b/activesupport/lib/active_support/railtie.rb
index 6eba24b569..ef22433491 100644
--- a/activesupport/lib/active_support/railtie.rb
+++ b/activesupport/lib/active_support/railtie.rb
@@ -23,6 +23,11 @@ module ActiveSupport
# Sets the default value for Time.zone
# If assigned value cannot be matched to a TimeZone, an exception will be raised.
initializer "active_support.initialize_time_zone" do |app|
+ begin
+ TZInfo::DataSource.get
+ rescue TZInfo::DataSourceNotFound => e
+ raise e.exception "tzinfo-data is not present. Please add gem 'tzinfo-data' to your Gemfile and run bundle install"
+ end
require 'active_support/core_ext/time/zones'
zone_default = Time.find_zone!(app.config.time_zone)