Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No source of timezone data could be found. (TZInfo::DataSourceNotFound) #8

Closed
hostingnuggets opened this issue Feb 11, 2016 · 4 comments
Closed
Labels

Comments

@hostingnuggets
Copy link

@hostingnuggets hostingnuggets commented Feb 11, 2016

With RailsInstaller 3.1.0 (Ruby 2.1) on Windows 2008 Server (32bit) I can't start my rails server because of the following error:

D:/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)`

In my Gemfile I am using the following entry for tzinfo-data:

gem 'tzinfo-data', '= 1.2016.1', platforms: [:x64_mingw, :mingw, :mswin], path: 'C:\Temp'

Note here that my server does not have any connection to outside that's why I specified the path in the Gemfile, where I have downloaded and stored the following gem: tzinfo-data-1.2016.1.gem

@philr
Copy link
Member

@philr philr commented Feb 11, 2016

The error means that TZInfo cannot locate tzinfo/data on the Ruby load path (or find a zoneinfo directory). Further information about the error can be found at https://tzinfo.github.io/datasourcenotfound.

Have you unpacked the tzinfo-data gem? The path option is supposed to reference the unpacked location for the gem (see http://bundler.io/gemfile.html). It sounds like you are saying that you have just downloaded tzinfo-data-1.2016.1.gem and saved it to C:\Temp (which won't work).

You can unpack the gem by running:

gem unpack --target C:\Temp C:\Temp\tzinfo-data-1.2016.1.gem

You'll then need to change the path option in your Gemfile to 'C:\Temp\tzinfo-data-1.2016.1'.

Alternatively, you could just install the gem from your downloaded file by running:

gem install C:\Temp\tzinfo-data-1.2016.1.gem

and then remove the path option from your Gemfile.

@philr philr added the question label Feb 11, 2016
@philr philr closed this Feb 11, 2016
@hostingnuggets
Copy link
Author

@hostingnuggets hostingnuggets commented Feb 11, 2016

@philr Thanks for the pointers, I have installed the gem as you recommended at it is located in D:\RailsInstaller\Ruby2.1.0\lib\ruby\gems\2.1.0\gems\tzinfo-data-1.2016.1\lib\tzinfo\data but still I get the same error message when I start the rails server.

How can I specify the tzinfo/data load path in Ruby? And in which config file would that be?

@philr
Copy link
Member

@philr philr commented Feb 11, 2016

Have you run bundle update since installing the tzinfo-data gem and modifying your Gemfile? If you don't have access to the Internet, then you'll need to either run bundle update --local or run bundle update on a different machine and then transfer the Gemfile.lock file across.

Bundler will take care of adding the gems you specify to the Ruby load path.

You might like to look at the section on Deploying Your Application in the Bundler documentation, which covers a process for deploying to a machine that doesn't have Internet access.

@hostingnuggets
Copy link
Author

@hostingnuggets hostingnuggets commented Feb 11, 2016

Thanks the bundle update --local did the trick and it now works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.