Simple Rails App: Error Cannot visit Integer

前端 未结 3 1042
温柔的废话
温柔的废话 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:16

    I got this error yesterday and created a workaround which should make it work with ruby 2.4 and rails 3.2.

    The commit that I got the idea from is at: https://github.com/rails/arel/commit/dc85a6e9c74942945ad696f5da4d82490a85b865

    Just include the following in your rails initializers.

    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::Visitor
          alias :visit_Integer :literal
        end
      end
    end
    

提交回复
热议问题