ActiveRecord::StatementInvalid. PG Error

前端 未结 2 1167
执念已碎
执念已碎 2021-02-12 17:27

I am trying to find a project from Project model using Project.find(id) but it is giving me ActiveRecord::StatementInvalid error

F

相关标签:
2条回答
  • 2021-02-12 18:04

    It's a bug somewhere in your Ruby stack.

    It's trying to prepare a statement called "a1" which is examining table/view definitions (presumably for your "project" table). It finds out a prepared statement with the same name already exists and spits out an error. The query it is trying to prepare is fine - it returns a count of how many tables have a given name.

    Either it's not tracking its prepared statements properly or it thinks it's deleted one and hasn't really. I'd update rails & activerecord and check for bug reports.

    0 讨论(0)
  • 2021-02-12 18:15

    all it needed was

     task "resque:setup" => :environment do
      #ENV['QUEUE'] = '*'
    
      Resque.before_fork = Proc.new { ActiveRecord::Base.establish_connection }
     end
    

    in your resque.rake file

    0 讨论(0)
提交回复
热议问题