diff options
author | Sushruth Sivaramakrishnan <sivsushruth@gmail.com> | 2015-03-03 02:38:47 +0530 |
---|---|---|
committer | Sushruth Sivaramakrishnan <sivsushruth@gmail.com> | 2015-03-04 06:34:11 +0530 |
commit | f81d80a3a47630604fb9c8aecdf90c93a45a0426 (patch) | |
tree | 2b48e68c30a8f91928fee165b22051b3ed67bc5a /activesupport | |
parent | 33ae6344834fdf71b93e0b6db899b58e017a7655 (diff) | |
download | rails-f81d80a3a47630604fb9c8aecdf90c93a45a0426.tar.gz rails-f81d80a3a47630604fb9c8aecdf90c93a45a0426.tar.bz2 rails-f81d80a3a47630604fb9c8aecdf90c93a45a0426.zip |
If TZInfo-data is not present in windows, let the user know.
Diffstat (limited to 'activesupport')
-rw-r--r-- | activesupport/lib/active_support/railtie.rb | 5 |
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) |