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

Rails 5 compatibility #473

Closed
avdmatamoros opened this Issue Nov 5, 2015 · 12 comments

Comments

Projects
None yet
@avdmatamoros

avdmatamoros commented Nov 5, 2015

attempting to run globalize on a rails5 api app I get:

'require': cannot load such file -- active_record/serializers/xml_serializer (LoadError)
...
from .../gems/globalize-4.0.3/lib/patches/active_record/xml_attribute_serializer.rb:1:in `<top (required)>'
...
from .../gems/globalize-4.0.3/lib/globalize.rb:2:in `<top (required)>'

It seems active_record/serializers/xml_serializer will no longer be available for rails 5 (at least for APIs), which will cause issues once it gets published.

@lessan

This comment has been minimized.

Show comment
Hide comment
@lessan

lessan Nov 6, 2015

I also got a similar error when attempting to migrate to Rails 5. It was because active_record/serializers/xml_serializer uses alias_method_chain, which is deprecated in Rails 5. Some more info here: http://www.justinweiss.com/articles/rails-5-module-number-prepend-and-the-end-of-alias-method-chain/

alias_method_chain is used in three places in globalize, and also twice in the globalize-versioning gem. We'll need to update them to use module#prepend and drop Ruby < 2.0 support to be able to use globalize with Rails 5.

lessan commented Nov 6, 2015

I also got a similar error when attempting to migrate to Rails 5. It was because active_record/serializers/xml_serializer uses alias_method_chain, which is deprecated in Rails 5. Some more info here: http://www.justinweiss.com/articles/rails-5-module-number-prepend-and-the-end-of-alias-method-chain/

alias_method_chain is used in three places in globalize, and also twice in the globalize-versioning gem. We'll need to update them to use module#prepend and drop Ruby < 2.0 support to be able to use globalize with Rails 5.

@batamire

This comment has been minimized.

Show comment
Hide comment
@batamire

batamire Dec 21, 2015

I can't do bundle update to Rails 5.0.0.beta1...

gem 'globalize', github: 'globalize/globalize'

Bundler could not find compatible versions for gem "activemodel":
  In Gemfile:
    globalize was resolved to 5.1.0, which depends on
      activemodel (< 4.3, >= 4.2.0)

    rails (= 5.0.0.beta1) was resolved to 5.0.0.beta1, which depends on
      activemodel (= 5.0.0.beta1)

batamire commented Dec 21, 2015

I can't do bundle update to Rails 5.0.0.beta1...

gem 'globalize', github: 'globalize/globalize'

Bundler could not find compatible versions for gem "activemodel":
  In Gemfile:
    globalize was resolved to 5.1.0, which depends on
      activemodel (< 4.3, >= 4.2.0)

    rails (= 5.0.0.beta1) was resolved to 5.0.0.beta1, which depends on
      activemodel (= 5.0.0.beta1)
@benbonnet

This comment has been minimized.

Show comment
Hide comment
@benbonnet

benbonnet Dec 22, 2015

bundle update will let you install with rails5, but it will return the error mentionned in the title

benbonnet commented Dec 22, 2015

bundle update will let you install with rails5, but it will return the error mentionned in the title

@scott

This comment has been minimized.

Show comment
Hide comment
@scott

scott commented Jan 22, 2016

+1

@juseveno

This comment has been minimized.

Show comment
Hide comment
@juseveno

juseveno Feb 4, 2016

same here

Bundler could not find compatible versions for gem "activemodel":
  In snapshot (Gemfile.lock):
    activemodel (= 5.0.0.beta2)

  In Gemfile:
    globalize was resolved to 5.1.0, which depends on
      activemodel (< 4.3, >= 4.2.0)

juseveno commented Feb 4, 2016

same here

Bundler could not find compatible versions for gem "activemodel":
  In snapshot (Gemfile.lock):
    activemodel (= 5.0.0.beta2)

  In Gemfile:
    globalize was resolved to 5.1.0, which depends on
      activemodel (< 4.3, >= 4.2.0)
@monkseal

This comment has been minimized.

Show comment
Hide comment
@monkseal

monkseal Feb 4, 2016

Does anybody have a fork out there that will work with rails 5?

monkseal commented Feb 4, 2016

Does anybody have a fork out there that will work with rails 5?

@tomash

This comment has been minimized.

Show comment
Hide comment
@tomash

tomash Feb 4, 2016

Contributor

There's already a work-in-progress PR #485 , I'll be happy to merge when it's done and green.

Contributor

tomash commented Feb 4, 2016

There's already a work-in-progress PR #485 , I'll be happy to merge when it's done and green.

@parndt parndt referenced this issue Mar 8, 2016

Merged

Rails 5 compatibility #485

9 of 9 tasks complete
@rhymes

This comment has been minimized.

Show comment
Hide comment
@rhymes

rhymes Jul 1, 2016

Contributor

@parndt any chance this patch can be loaded only if XmlSerializer is actually there? https://github.com/globalize/globalize/blob/master/lib/patches/active_record/xml_attribute_serializer.rb

It's not there in Rails 5 by default anymore.

See rails/rails#21161 and https://github.com/rails/activemodel-serializers-xml

Thanks!

Contributor

rhymes commented Jul 1, 2016

@parndt any chance this patch can be loaded only if XmlSerializer is actually there? https://github.com/globalize/globalize/blob/master/lib/patches/active_record/xml_attribute_serializer.rb

It's not there in Rails 5 by default anymore.

See rails/rails#21161 and https://github.com/rails/activemodel-serializers-xml

Thanks!

@parndt

This comment has been minimized.

Show comment
Hide comment
@parndt

parndt Jul 1, 2016

Member

Can you fix it please? 😄

Member

parndt commented Jul 1, 2016

Can you fix it please? 😄

@rhymes

This comment has been minimized.

Show comment
Hide comment
@rhymes

rhymes Jul 1, 2016

Contributor

@parndt I tried in #524 but there are three more issues:

Contributor

rhymes commented Jul 1, 2016

@parndt I tried in #524 but there are three more issues:

@muhammet

This comment has been minimized.

Show comment
Hide comment
@muhammet

muhammet commented Jul 5, 2016

+1

@parndt

This comment has been minimized.

Show comment
Hide comment
@parndt

parndt Jul 5, 2016

Member

Fixes for all those were merged already, are you still having trouble?

Member

parndt commented Jul 5, 2016

Fixes for all those were merged already, are you still having trouble?

@parndt parndt closed this Jul 5, 2016

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