Rails: No connection pool for ActiveRecord::Base

后端 未结 9 1080
梦毁少年i
梦毁少年i 2020-12-29 07:27

I\'m trying to use rails 4.2.6 to develop an app. I\'m trying to use postgres for database. Server starts fine but when I try loading a page it throws this \"No connection p

9条回答
  •  误落风尘
    2020-12-29 08:09

    If you are experiencing this error from a rake task, chances are you are not running the :environment task before your task.

    Changing:

    task :task_name do
    end
    

    to:

    task task_name: :environment do
    end
    

    Should fix the issue.

提交回复
热议问题