Solve Error in Windows Command: TZInfo::DataSourceNotFound

How to Resolve TZInfo::DataSourceNotFound Error

If you are using Windows to make Ruby on Rails apps and come across this error in your command prompt when trying to run the Rails server:

C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/tzinfo-1.2.2/lib/tzinfo/data_source.rb:182:in `rescue in create_default_data_source': No source of timezone data could be found. (TZInfo::DataSourceNotFound)
Please refer to http://tzinfo.github.io/datasourcenotfound for help resolving this error.

Add this to the Gemfile in your app:

gem 'tzinfo-data', platforms: [:mingw, :mswin]

Run $bundle install
And then run your Rails server again. $rails server

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s