I have searched for a similar problem for the past couple hours and have not found a solution. My database contains a User, Game, and Save class with migration files to correspond. When I run my game, it says
rake aborted!
ActiveRecord::StatementInvalid: Could not find table 'users'
Yesterday, I was able to run my program without any issues and it would seem something else may be the problem. When I run rake db:migrate or any other rake commands, nothing updates in the schema or db folder. I'm out of options for what the solution can be. Please help.
I am running my code on Visual Studio Code through the built-in terminal. I run my code by typing ruby bin/run.rb
tty::prompt is used to navigate through the menus. When trying to create a new User or login to a user, it states the table for 'users' cannot be found.
When I run rake db:migrate --trace
It traces
rake db:migrate --trace
███████╗ ██████╗ ██████╗ ██████╗███████╗██████╗ ███████╗██████╗
██╔════╝██╔═══██╗██╔══██╗██╔════╝██╔════╝██╔══██╗██╔════╝██╔══██╗
███████╗██║ ██║██████╔╝██║ █████╗ ██████╔╝█████╗ ██████╔╝
╚════██║██║ ██║██╔══██╗██║ ██╔══╝ ██╔══██╗██╔══╝ ██╔══██╗
███████║╚██████╔╝██║ ██║╚██████╗███████╗██║ ██║███████╗██║ ██║
╚══════╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
Are you a new user? no
Login
what is your chosen name? xemnikk
rake aborted!
ActiveRecord::StatementInvalid: Could not find table 'users'
/Users/tobyboudreaux/.rvm/gems/ruby-2.6.1/gems/activerecord-6.0.3.2/lib/active_record/connection_adapters/sqlite3_adapter.rb:358:in `table_structure'
/Users/tobyboudreaux/.rvm/gems/ruby-2.6.1/gems/activerecord-6.0.3.2/lib/active_record/connection_adapters/abstract/schema_statements.rb:114:in `columns'
/Users/tobyboudreaux/.rvm/gems/ruby-2.6.1/gems/activerecord-6.0.3.2/lib/active_record/connection_adapters/schema_cache.rb:76:in `columns'
/Users/tobyboudreaux/.rvm/gems/ruby-2.6.1/gems/activerecord-6.0.3.2/lib/active_record/connection_adapters/schema_cache.rb:82:in `columns_hash'
/Users/tobyboudreaux/.rvm/gems/ruby-2.6.1/gems/activerecord-6.0.3.2/lib/active_record/model_schema.rb:488:in `load_schema!'
/Users/tobyboudreaux/.rvm/gems/ruby-2.6.1/gems/activerecord-6.0.3.2/lib/active_record/attributes.rb:247:in `load_schema!'
/Users/tobyboudreaux/.rvm/gems/ruby-2.6.1/gems/activerecord-6.0.3.2/lib/active_record/attribute_decorators.rb:50:in `load_schema!'
/Users/tobyboudreaux/.rvm/gems/ruby-2.6.1/gems/activerecord-6.0.3.2/lib/active_record/model_schema.rb:478:in `block in load_schema'
/Users/tobyboudreaux/.rvm/rubies/ruby-2.6.1/lib/ruby/2.6.0/monitor.rb:230:in `mon_synchronize'
/Users/tobyboudreaux/.rvm/gems/ruby-2.6.1/gems/activerecord-6.0.3.2/lib/active_record/model_schema.rb:475:in `load_schema'
/Users/tobyboudreaux/.rvm/gems/ruby-2.6.1/gems/activerecord-6.0.3.2/lib/active_record/model_schema.rb:352:in `columns_hash'
/Users/tobyboudreaux/.rvm/gems/ruby-2.6.1/gems/activerecord-6.0.3.2/lib/active_record/core.rb:184:in `find_by'
/Users/tobyboudreaux/Flatiron/Code/Mod 1/ruby-project-guidelines-atx01-seng-ft-060120/lib/Main.rb:15:in `find_user'
/Users/tobyboudreaux/Flatiron/Code/Mod 1/ruby-project-guidelines-atx01-seng-ft-060120/lib/Main.rb:93:in `login'
/Users/tobyboudreaux/Flatiron/Code/Mod 1/ruby-project-guidelines-atx01-seng-ft-060120/lib/Main.rb:106:in `greet_user'
/Users/tobyboudreaux/Flatiron/Code/Mod 1/ruby-project-guidelines-atx01-seng-ft-060120/lib/Main.rb:111:in `<class:Main>'
/Users/tobyboudreaux/Flatiron/Code/Mod 1/ruby-project-guidelines-atx01-seng-ft-060120/lib/Main.rb:1:in `<top (required)>'
/Users/tobyboudreaux/.rvm/gems/ruby-2.6.1/gems/require_all-3.0.0/lib/require_all.rb:208:in `require'
/Users/tobyboudreaux/.rvm/gems/ruby-2.6.1/gems/require_all-3.0.0/lib/require_all.rb:208:in `__require'
/Users/tobyboudreaux/.rvm/gems/ruby-2.6.1/gems/require_all-3.0.0/lib/require_all.rb:98:in `block in require_all'
/Users/tobyboudreaux/.rvm/gems/ruby-2.6.1/gems/require_all-3.0.0/lib/require_all.rb:96:in `each'
/Users/tobyboudreaux/.rvm/gems/ruby-2.6.1/gems/require_all-3.0.0/lib/require_all.rb:96:in `require_all'
/Users/tobyboudreaux/Flatiron/Code/Mod 1/ruby-project-guidelines-atx01-seng-ft-060120/config/environment.rb:5:in `<top (required)>'
/Users/tobyboudreaux/Flatiron/Code/Mod 1/ruby-project-guidelines-atx01-seng-ft-060120/Rakefile:1:in `require_relative'
/Users/tobyboudreaux/Flatiron/Code/Mod 1/ruby-project-guidelines-atx01-seng-ft-060120/Rakefile:1:in `<top (required)>'
/Users/tobyboudreaux/.rvm/gems/ruby-2.6.1/gems/rake-13.0.1/lib/rake/rake_module.rb:29:in `load'
/Users/tobyboudreaux/.rvm/gems/ruby-2.6.1/gems/rake-13.0.1/lib/rake/rake_module.rb:29:in `load_rakefile'
/Users/tobyboudreaux/.rvm/gems/ruby-2.6.1/gems/rake-13.0.1/lib/rake/application.rb:703:in `raw_load_rakefile'
/Users/tobyboudreaux/.rvm/gems/ruby-2.6.1/gems/rake-13.0.1/lib/rake/application.rb:104:in `block in load_rakefile'
/Users/tobyboudreaux/.rvm/gems/ruby-2.6.1/gems/rake-13.0.1/lib/rake/application.rb:186:in `standard_exception_handling'
/Users/tobyboudreaux/.rvm/gems/ruby-2.6.1/gems/rake-13.0.1/lib/rake/application.rb:103:in `load_rakefile'
/Users/tobyboudreaux/.rvm/gems/ruby-2.6.1/gems/rake-13.0.1/lib/rake/application.rb:82:in `block in run'
/Users/tobyboudreaux/.rvm/gems/ruby-2.6.1/gems/rake-13.0.1/lib/rake/application.rb:186:in `standard_exception_handling'
/Users/tobyboudreaux/.rvm/gems/ruby-2.6.1/gems/rake-13.0.1/lib/rake/application.rb:80:in `run'
/Users/tobyboudreaux/.rvm/gems/ruby-2.6.1/gems/rake-13.0.1/exe/rake:27:in `<top (required)>'
/Users/tobyboudreaux/.rvm/gems/ruby-2.6.1/bin/rake:23:in `load'
/Users/tobyboudreaux/.rvm/gems/ruby-2.6.1/bin/rake:23:in `<main>'
/Users/tobyboudreaux/.rvm/gems/ruby-2.6.1/bin/ruby_executable_hooks:24:in `eval'
/Users/tobyboudreaux/.rvm/gems/ruby-2.6.1/bin/ruby_executable_hooks:24:in `<main>'