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

Closed
hostingnuggets opened this Issue Feb 11, 2016 · 4 comments

Comments

Projects
None yet
2 participants
@hostingnuggets

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:inrescue 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

This comment has been minimized.

Show comment
Hide comment
@philr

philr Feb 11, 2016

Member

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.

Member

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

This comment has been minimized.

Show comment
Hide comment
@hostingnuggets

hostingnuggets 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 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

This comment has been minimized.

Show comment
Hide comment
@philr

philr Feb 11, 2016

Member

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.

Member

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

This comment has been minimized.

Show comment
Hide comment
@hostingnuggets

hostingnuggets Feb 11, 2016

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

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