Ruby on Rails Thursday, March 31, 2016

I am getting the following error in production environment

"PG::DupliacatePstatement: Error: prepared statement already exists"

Ruby version is 2.2.4 and
Rails version is 4.1.3

I have the following code in my unicorn.rb file:

before_fork do |server, worker|
Signal.trap 'TERM' do
puts 'Unicorn master intercepting TERM and sending myself QUIT
instead'
Process.kill 'QUIT', Process.pid
end

defined?(ActiveRecord::Base) and
ActiveRecord::Base.connection.disconnect!
end

after_fork do |server, worker|
Signal.trap 'TERM' do
puts 'Unicorn worker intercepting TERM and doing nothing. Wait
for master to send QUIT'
end

defined?(ActiveRecord::Base) and
ActiveRecord::Base.establish_connection
end

I have added

prepared_statement: false

in database.yml file. In environments/production.rb file, I have

config.cache_classes = false
config.action_controller.perform_caching = false

Can anyone please suggest a solution for this error?


[1]: http://i.stack.imgur.com/Qzm7Z.jpg

Attachments:
http://www.ruby-forum.com/attachment/11326/fd35c989-0aca-488b-b57d-82ec642ae206.jpg


--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/d48c0f8a589d3c89a862600a0e1a0cc3%40ruby-forum.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment