ActiveRecord::ConnectionNotEstablished - No connection pool for X ActiveRecord::ConnectionNotEstablished - No connection pool for X postgresql postgresql

ActiveRecord::ConnectionNotEstablished - No connection pool for X


Please check how your sinatra app established the connection

configure :production, :development do  db = URI.parse(ENV['DATABASE_URL'] || 'postgres://localhost/mydb')  pool = ENV["DB_POOL"] || ENV['MAX_THREADS'] || 5  ActiveRecord::Base.establish_connection(        adapter:  db.scheme == 'postgres' ? 'postgresql' : db.scheme,        host:      db.host,        username:  db.user,        password:  db.password,        database:  db.path[1..-1],        encoding:  'utf8',        pool:      pool  )end

Make sure you have proper settings for pool, also make sure you have a heroku config for DB_POOL or MAX_THREADS.

heroku config:set DB_POOL=5

or

heroku config:set MAX_THREADS=5