stack twitter rss linkedin cross

Wilco van Esch

Skip to main content

Search results

    Time zone / tzinfo-data issue running Rails on 64-bit Windows

    When running a Rails server on a 64-bit Windows installation, you may encounter:

    rescue in create_default_data_source': No timezone data source could be found. To resolve this, either install TZInfo::Data (e.g. by runninggem install tzinfo-data) or specify a zoneinfo directory usingTZInfo::DataSource.set(:zoneinfo, zoneinfo_path)`. (TZInfo::DataSourceNotFound)
    

    To solve this:

    • Ensure bundler is installed (gem install bundler).
    • In your Rails project's root folder, edit the Gemfile.
    • Find the tzinfo-data line in the Gemfile.
    • Change the line to: gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw].
    • From the command line from within the same folder, run bundle.

    If Windows' security settings won't allow you to save the Gemfile change, edit permissions of the folder by right-clicking it and selecting: Properties > Security > Edit > enter administrator details > give Users account write permissions > Apply