我正在为一个客户开发一个站点,试图将站点从Rails 4.2更新到5.2。不过,我遇到了一个问题,因为这个网站使用了一个名为Cyrax的宝石。。。
https://github.com/droidlabs/cyrax
这个gem自2016年以来就没有更新过,并在rails app:update上抛出了一个XML序列化程序错误。我发现关于它的信息很少。
有没有人知道一个替代方案或一种方法来完成更新?我想我可以尝试分叉gem并更新有问题的代码,但我不知道这是否只是Rails 5的问题。我不想浪费我的客户的时间打开一罐蠕虫如果我不需要。
以下是我在app:update上遇到的错误
$ rails app:update --trace
rails aborted!
NameError: uninitialized constant ActiveModel::Serializers::Xml
/Users/uname/.rbenv/versions/2.3.8/lib/ruby/gems/2.3.0/gems/cyrax-0.7.8/lib/cyrax/decorator.rb:5:in `<class:Decorator>'
/Users/uname/.rbenv/versions/2.3.8/lib/ruby/gems/2.3.0/gems/cyrax-0.7.8/lib/cyrax/decorator.rb:2:in `<top (required)>'
/Users/uname/.rbenv/versions/2.3.8/lib/ruby/gems/2.3.0/gems/cyrax-0.7.8/lib/cyrax.rb:19:in `<top (required)>'
/Users/uname/.rbenv/versions/2.3.8/lib/ruby/gems/2.3.0/gems/bundler-1.17.3/lib/bundler/runtime.rb:81:in `require'
/Users/uname/.rbenv/versions/2.3.8/lib/ruby/gems/2.3.0/gems/bundler-1.17.3/lib/bundler/runtime.rb:81:in `block (2 levels) in require'
/Users/uname/.rbenv/versions/2.3.8/lib/ruby/gems/2.3.0/gems/bundler-1.17.3/lib/bundler/runtime.rb:76:in `each'
/Users/uname/.rbenv/versions/2.3.8/lib/ruby/gems/2.3.0/gems/bundler-1.17.3/lib/bundler/runtime.rb:76:in `block in require'
/Users/uname/.rbenv/versions/2.3.8/lib/ruby/gems/2.3.0/gems/bundler-1.17.3/lib/bundler/runtime.rb:65:in `each'
/Users/uname/.rbenv/versions/2.3.8/lib/ruby/gems/2.3.0/gems/bundler-1.17.3/lib/bundler/runtime.rb:65:in `require'
/Users/uname/.rbenv/versions/2.3.8/lib/ruby/gems/2.3.0/gems/bundler-1.17.3/lib/bundler.rb:114:in `require'
/Users/uname/sites/clientname/appname/config/application.rb:7:in `<top (required)>'
/Users/uname/sites/clientname/appname/Rakefile:4:in `require'
/Users/uname/sites/clientname/appname/Rakefile:4:in `<top (required)>'
/Users/uname/.rbenv/versions/2.3.8/lib/ruby/gems/2.3.0/gems/rake-12.3.2/lib/rake/rake_module.rb:29:in `load'
/Users/uname/.rbenv/versions/2.3.8/lib/ruby/gems/2.3.0/gems/rake-12.3.2/lib/rake/rake_module.rb:29:in `load_rakefile'
/Users/uname/.rbenv/versions/2.3.8/lib/ruby/gems/2.3.0/gems/rake-12.3.2/lib/rake/application.rb:703:in `raw_load_rakefile'
/Users/uname/.rbenv/versions/2.3.8/lib/ruby/gems/2.3.0/gems/rake-12.3.2/lib/rake/application.rb:104:in `block in load_rakefile'
/Users/uname/.rbenv/versions/2.3.8/lib/ruby/gems/2.3.0/gems/rake-12.3.2/lib/rake/application.rb:186:in `standard_exception_handling'
/Users/uname/.rbenv/versions/2.3.8/lib/ruby/gems/2.3.0/gems/rake-12.3.2/lib/rake/application.rb:103:in `load_rakefile'
/Users/uname/.rbenv/versions/2.3.8/lib/ruby/gems/2.3.0/gems/railties-5.1.0/lib/rails/commands/rake/rake_command.rb:20:in `block in perform'
/Users/uname/.rbenv/versions/2.3.8/lib/ruby/gems/2.3.0/gems/rake-12.3.2/lib/rake/application.rb:186:in `standard_exception_handling'
/Users/uname/.rbenv/versions/2.3.8/lib/ruby/gems/2.3.0/gems/railties-5.1.0/lib/rails/commands/rake/rake_command.rb:18:in `perform'
/Users/uname/.rbenv/versions/2.3.8/lib/ruby/gems/2.3.0/gems/railties-5.1.0/lib/rails/command.rb:46:in `invoke'
/Users/uname/.rbenv/versions/2.3.8/lib/ruby/gems/2.3.0/gems/railties-5.1.0/lib/rails/commands.rb:16:in `<top (required)>'
bin/rails:4:in `require'
bin/rails:4:in `<main>'