ruby - Error when running cmd <rake db:migrate> - "No connection pool with 'primary' found" -
i'm trying set sqlite db sinatra app , running error can't figure out. i've looked related questions none of them have helped.
up point i've run bundle exec rake db:create_migration name=create_budget
created migration in db folder.
however when run bundle exec rake db:migrate
following error message:
activerecord::connectionnotestablished: no connection pool 'primary' found.
i following tutorial https://learn.co/lessons/sinatra-activerecord-setup
database.yml - instructions did not create in researching error seemed keep coming up. still magic me learn i'm not sure if activerecord requires or not.
# sqlite version 3.x # gem install sqlite3-ruby (not necessary on os x leopard) development: adapter: sqlite3 database: db/development.sqlite3 pool: 5 timeout: 5000 # warning: database defined "test" erased , # re-generated development database when run "rake". # not set db same development or production. test: adapter: sqlite3 database: db/test.sqlite3 pool: 5 timeout: 5000 production: adapter: sqlite3 database: db/production.sqlite3 pool: 5 timeout: 5000
migrate: created db:create_migration
# database migration class createbudget < activerecord::migration[5.1] def change create_table :budget |t| t.string :description t.string :amount end end end
gemfile:
# frozen_string_literal: true source 'https://rubygems.org' git_source(:github) { |repo_name| "https://github.com/#{repo_name}" } # gem "rails" gem 'activerecord' gem 'rake' gem 'require_all' gem 'sinatra' gem 'sinatra-activerecord' gem 'slim' gem 'thin' group :development gem 'pry' gem 'shotgun' gem 'sqlite3' gem 'tux' end
file structure - not sure if helpful or not
Comments
Post a Comment