Undefined method 'to_local' for #<TZInfo::TimezonePeriod:0x007fcbd3575d18> #62

Closed
secondstreetmedia opened this Issue Dec 8, 2016 · 2 comments

Comments

Projects
None yet
2 participants
@secondstreetmedia

Without (I believe) having changed my code, I'm now getting this error:

NoMethodError: undefined method `to_local' for #<TZInfo::TimezonePeriod:0x007fcbd3575d18>

This appears, at least at first glance, to be related to the change that was made in the latest update of the gem:

Move to_local and to_utc conversions into Timezone.
It doesn't really make sense to have methods on TimezonePeriod that can
convert times outside of the range of the period.

Any suggestions as to what I might do to resolve this. It's causing my database migration and seeding to fail.

Thanks,
Tim

@philr

This comment has been minimized.

Show comment
Hide comment
@philr

philr Dec 8, 2016

Member

That change (873d4cd) is only in git at the moment. It is not part of a released version of the tzinfo gem.

I wouldn't recommend using the latest code in git for production purposes at the moment - I'm making some fairly substantial changes that will eventually end up in a v2 release.

If you're calling TZInfo::TimezonePeriod#to_local in your own code, then you should switch to TZInfo::Timezone#utc_to_local or TZInfo::Timezone#to_local instead (the latter is only available in git at the moment).

If you are using Rails (which currently uses TZInfo::TimezonePeriod#to_local), then you'll need to switch to a version of TZInfo that is compatible with Rails - either the latest release (currently v1.2.2) or an earlier commit from git.

Member

philr commented Dec 8, 2016

That change (873d4cd) is only in git at the moment. It is not part of a released version of the tzinfo gem.

I wouldn't recommend using the latest code in git for production purposes at the moment - I'm making some fairly substantial changes that will eventually end up in a v2 release.

If you're calling TZInfo::TimezonePeriod#to_local in your own code, then you should switch to TZInfo::Timezone#utc_to_local or TZInfo::Timezone#to_local instead (the latter is only available in git at the moment).

If you are using Rails (which currently uses TZInfo::TimezonePeriod#to_local), then you'll need to switch to a version of TZInfo that is compatible with Rails - either the latest release (currently v1.2.2) or an earlier commit from git.

@secondstreetmedia

This comment has been minimized.

Show comment
Hide comment
@secondstreetmedia

secondstreetmedia Dec 9, 2016

Thanks for the response. I have been using the git version, but I don't have anything in production, so no worries there. I am using Rails, so I'll switch to v1.2.2.

Looking forward to v2!

Thanks for the response. I have been using the git version, but I don't have anything in production, so no worries there. I am using Rails, so I'll switch to v1.2.2.

Looking forward to v2!

@philr philr closed this Dec 9, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment