If TZInfo-data is not present in windows, let the user know.

This commit is contained in:
Sushruth Sivaramakrishnan 2015-03-03 02:38:47 +05:30
parent 33ae634483
commit f81d80a3a4
1 changed files with 5 additions and 0 deletions

View File

@ -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)