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

JRuby - tzinfo error #37

Closed
aplatypus opened this issue Mar 20, 2015 · 2 comments
Closed

JRuby - tzinfo error #37

aplatypus opened this issue Mar 20, 2015 · 2 comments
Labels

Comments

@aplatypus
Copy link

I had this earlier, and it is persisting. I am getting:

  • jruby -S middleman server

Any way, things fail with a timezone error:

TZInfo::DataSourceNotFound: No source of timezone data could be found.
Please refer to http://tzinfo.github.io/datasourcenotfound for help resolving this error.
  create_default_data_source at B:/lang/ruby/v09.00-jRuby/lib/ruby/gems/shared/gems/tzinfo-1.2.2/lib/tzinfo/data_source.rb:182
                         get at B:/lang/ruby/v09.00-jRuby/lib/ruby/gems/shared/gems/tzinfo-1.2.2/lib/tzinfo/data_source.rb:41
                 synchronize at org/jruby/ext/thread/Mutex.java:151
 jruby -S gem list tzinfo  --local

  *** LOCAL GEMS ***

  tzinfo (1.2.2)
  tzinfo-data (1.2015.1)

A look-see at this page (given in the stacktrace):

  TZInfo::DataSourceNotFound: No source of timezone data could be found.
  Please refer to http://tzinfo.github.io/datasourcenotfound for help resolving this error.

After installing the tzinfo-data gem things are the same (no effect). As far as I can see, things are "as written", yet there is no timezone-data. What can I do next?

Configuration:

  • JRuby 9.0.0.0.pre1 (2.2.0p0) 2015-01-20 d537cab
  • Java HotSpot(TM) 64-Bit Server VM 25.25-b02 on 1.8.0_25-b18 +jit
  • [Windows 7-amd64] sp1
  • jruby -S middleman server
      ~~~~    ~~~~    ~~~~    ~~~~    ~~~~    ~~~~
WARN: Unresolved specs during Gem::Specification.reset:
      json (>= 1.7.7, ~> 1.7)
      minitest (~> 5.1)
WARN: Clearing out unresolved specs.
Please report a bug if this causes problems.
== The Middleman is loading
TZInfo::DataSourceNotFound: No source of timezone data could be found.
Please refer to http://tzinfo.github.io/datasourcenotfound for help resolving this error.
  create_default_data_source at B:/lang/ruby/v09.00-jRuby/lib/ruby/gems/shared/gems/tzinfo-1.2.2/lib/tzinfo/data_source.rb:182
                         get at B:/lang/ruby/v09.00-jRuby/lib/ruby/gems/shared/gems/tzinfo-1.2.2/lib/tzinfo/data_source.rb:41
                 synchronize at org/jruby/ext/thread/Mutex.java:151
                         get at B:/lang/ruby/v09.00-jRuby/lib/ruby/gems/shared/gems/tzinfo-1.2.2/lib/tzinfo/data_source.rb:39
                 data_source at B:/lang/ruby/v09.00-jRuby/lib/ruby/gems/shared/gems/tzinfo-1.2.2/lib/tzinfo/timezone.rb:629
                         get at B:/lang/ruby/v09.00-jRuby/lib/ruby/gems/shared/gems/tzinfo-1.2.2/lib/tzinfo/timezone.rb:92
               real_timezone at B:/lang/ruby/v09.00-jRuby/lib/ruby/gems/shared/gems/tzinfo-1.2.2/lib/tzinfo/timezone_proxy.rb:67
              period_for_utc at B:/lang/ruby/v09.00-jRuby/lib/ruby/gems/shared/gems/tzinfo-1.2.2/lib/tzinfo/timezone_proxy.rb:30
              current_period at B:/lang/ruby/v09.00-jRuby/lib/ruby/gems/shared/gems/tzinfo-1.2.2/lib/tzinfo/timezone.rb:549
                 public_send at org/jruby/RubyKernel.java:1832
                         try at B:/lang/ruby/v09.00-jRuby/lib/ruby/gems/shared/gems/activesupport-4.1.9/lib/active_support/core_ext/object/try.rb:45
                  utc_offset at B:/lang/ruby/v09.00-jRuby/lib/ruby/gems/shared/gems/activesupport-4.1.9/lib/active_support/values/time_zone.rb:223
                          [] at B:/lang/ruby/v09.00-jRuby/lib/ruby/gems/shared/gems/activesupport-4.1.9/lib/active_support/values/time_zone.rb:396
                         tap at org/jruby/RubyKernel.java:1762
                          [] at B:/lang/ruby/v09.00-jRuby/lib/ruby/gems/shared/gems/activesupport-4.1.9/lib/active_support/values/time_zone.rb:396
                  find_zone! at B:/lang/ruby/v09.00-jRuby/lib/ruby/gems/shared/gems/activesupport-4.1.9/lib/active_support/core_ext/time/zones.rb:61
         after_configuration at B:/lang/ruby/v09.00-jRuby/lib/ruby/gems/shared/gems/middleman-blog-3.5.3/lib/middleman-blog/extension.rb:106
    bind_after_configuration at B:/lang/ruby/v09.00-jRuby/lib/ruby/gems/shared/gems/middleman-core-3.3.10/lib/middleman-core/extension.rb:131
               instance_exec at org/jruby/RubyBasicObject.java:1678
                       proc! at B:/lang/ruby/v09.00-jRuby/lib/ruby/gems/shared/gems/uber-0.0.13/lib/uber/options.rb:80
                evaluate_for at B:/lang/ruby/v09.00-jRuby/lib/ruby/gems/shared/gems/uber-0.0.13/lib/uber/options.rb:70
                    evaluate at B:/lang/ruby/v09.00-jRuby/lib/ruby/gems/shared/gems/uber-0.0.13/lib/uber/options.rb:60
            execute_callback at B:/lang/ruby/v09.00-jRuby/lib/ruby/gems/shared/gems/hooks-0.4.0/lib/hooks/hook.rb:53
                         run at B:/lang/ruby/v09.00-jRuby/lib/ruby/gems/shared/gems/hooks-0.4.0/lib/hooks/hook.rb:40
                        each at org/jruby/RubyArray.java:1569
                      inject at org/jruby/RubyEnumerable.java:857
                         run at B:/lang/ruby/v09.00-jRuby/lib/ruby/gems/shared/gems/hooks-0.4.0/lib/hooks/hook.rb:39
                run_hook_for at B:/lang/ruby/v09.00-jRuby/lib/ruby/gems/shared/gems/hooks-0.4.0/lib/hooks.rb:55
                    run_hook at B:/lang/ruby/v09.00-jRuby/lib/ruby/gems/shared/gems/hooks-0.4.0/lib/hooks/instance_hooks.rb:6
                  initialize at B:/lang/ruby/v09.00-jRuby/lib/ruby/gems/shared/gems/middleman-core-3.3.10/lib/middleman-core/core_extensions/extensions.rb:179
                  initialize at B:/lang/ruby/v09.00-jRuby/lib/ruby/gems/shared/gems/middleman-core-3.3.10/lib/middleman-core/core_extensions/data.rb:33
                  initialize at B:/lang/ruby/v09.00-jRuby/lib/ruby/gems/shared/gems/middleman-core-3.3.10/lib/middleman-core/application.rb:188
                        inst at B:/lang/ruby/v09.00-jRuby/lib/ruby/gems/shared/gems/middleman-core-3.3.10/lib/middleman-core/core_extensions/request.rb:52
                     new_app at B:/lang/ruby/v09.00-jRuby/lib/ruby/gems/shared/gems/middleman-core-3.3.10/lib/middleman-core/preview_server.rb:103
                       start at B:/lang/ruby/v09.00-jRuby/lib/ruby/gems/shared/gems/middleman-core-3.3.10/lib/middleman-core/preview_server.rb:21
                      server at B:/lang/ruby/v09.00-jRuby/lib/ruby/gems/shared/gems/middleman-core-3.3.10/lib/middleman-core/cli/server.rb:78
                         run at B:/lang/ruby/v09.00-jRuby/lib/ruby/gems/shared/gems/thor-0.19.1/lib/thor/command.rb:27
              invoke_command at B:/lang/ruby/v09.00-jRuby/lib/ruby/gems/shared/gems/thor-0.19.1/lib/thor/invocation.rb:126
                    dispatch at B:/lang/ruby/v09.00-jRuby/lib/ruby/gems/shared/gems/thor-0.19.1/lib/thor.rb:359
                       start at B:/lang/ruby/v09.00-jRuby/lib/ruby/gems/shared/gems/thor-0.19.1/lib/thor/base.rb:440
              method_missing at B:/lang/ruby/v09.00-jRuby/lib/ruby/gems/shared/gems/middleman-core-3.3.10/lib/middleman-core/cli.rb:72
                         run at B:/lang/ruby/v09.00-jRuby/lib/ruby/gems/shared/gems/thor-0.19.1/lib/thor/command.rb:29
                         run at B:/lang/ruby/v09.00-jRuby/lib/ruby/gems/shared/gems/thor-0.19.1/lib/thor/command.rb:126
              invoke_command at B:/lang/ruby/v09.00-jRuby/lib/ruby/gems/shared/gems/thor-0.19.1/lib/thor/invocation.rb:126
                    dispatch at B:/lang/ruby/v09.00-jRuby/lib/ruby/gems/shared/gems/thor-0.19.1/lib/thor.rb:359
                       start at B:/lang/ruby/v09.00-jRuby/lib/ruby/gems/shared/gems/thor-0.19.1/lib/thor/base.rb:440
                       start at B:/lang/ruby/v09.00-jRuby/lib/ruby/gems/shared/gems/middleman-core-3.3.10/lib/middleman-core/cli.rb:20
                      (root) at B:/lang/ruby/v09.00-jRuby/lib/ruby/gems/shared/gems/middleman-core-3.3.10/bin/middleman:18
                        load at org/jruby/RubyKernel.java:969
@philr
Copy link
Member

philr commented Mar 20, 2015

It looks like Middleman generates a Bundler Gemfile that includes the following line:

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

This will cause tzinfo-data to be loaded on native Windows builds of Ruby, but not on JRuby.

To solve this issue, edit the Gemfile in your Middleman project directory and add :jruby to the :platforms option:

gem "tzinfo-data", platforms: [:mswin, :mingw, :jruby]

After doing this, run bundle update from your Middleman project directory and you should then be able to start your server.

@aplatypus
Copy link
Author

Many thanks.

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

No branches or pull requests

2 participants