Simple Rails App: Error Cannot visit Integer

前端 未结 3 1085
温柔的废话
温柔的废话 2021-01-07 17:15

I am trying to build a simple Rails app. Rails v3.2.22.5 (it is a requirement). I am running it with PostgreSQL. When I start the server however I get the following error wh

3条回答
  •  醉酒成梦
    2021-01-07 17:34

    For future Googlers. I had the same problem but I needed to apply a variant of Thomas Dziedzic solution.

    I have ruby 2.5.1 and rails 4.2.10 running in my system.

    As shown in this commit ToSql was changed from Arel::Visitors::Visitorto Arel::Visitors::Reduce

    So this is my updated solution. In a rails initializer put this:

    module Arel
      module Visitors
        class DepthFirst < Arel::Visitors::Visitor
          alias :visit_Integer :terminal
        end
    
        class Dot < Arel::Visitors::Visitor
          alias :visit_Integer :visit_String
        end
    
        class ToSql < Arel::Visitors::Reduce
          alias :visit_Integer :literal
        end
      end
    end
    

提交回复
热议问题