Rails: No connection pool for ActiveRecord::Base

后端 未结 9 1018
梦毁少年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:07

    This issue arises when the server cannot find the corresponding database it depends on to pull data from.

    I had same issue from my end, I updated my version of Sqlite3, and it was higher than the version that the current Puma Server version supports.

    I simply had to uninstall the Sqlite3 version, and then install the version supported by the current version of Puma Server.

    gem uninstall sqlite3
    

    This will uninstall the updated version of Sqlite3, and then you run the code below stating the version supported by your current server.

    gem install sqlite3
    

    Or you can as well open your Gemfile, and then include the version for the database that you are using

    gem 'sqlite3', '~> 1.3.6' 
    

    N/B: The sqlite3 version is the most current version as at the time of writing this answer

    And then run

    bundle update
    

    to install the version of the database that you specified.

    That's all.

    I hope this helps.

提交回复
热议问题