0

I have a problem with my RoR application. It boots up just fine, but when I open it I get the following error:

error

It says it's a framework error:

activerecord (5.0.7.2) lib/active_record/connection_adapters/sqlite3_adapter.rb:27:in `initialize'
activerecord (5.0.7.2) lib/active_record/connection_adapters/sqlite3_adapter.rb:27:in `new'
activerecord (5.0.7.2) lib/active_record/connection_adapters/sqlite3_adapter.rb:27:in `sqlite3_connection'
activerecord (5.0.7.2) lib/active_record/connection_adapters/abstract/connection_pool.rb:729:in `new_connection'
activerecord (5.0.7.2) lib/active_record/connection_adapters/abstract/connection_pool.rb:773:in `checkout_new_connection'
activerecord (5.0.7.2) lib/active_record/connection_adapters/abstract/connection_pool.rb:752:in `try_to_checkout_new_connection'
activerecord (5.0.7.2) lib/active_record/connection_adapters/abstract/connection_pool.rb:713:in `acquire_connection'
activerecord (5.0.7.2) lib/active_record/connection_adapters/abstract/connection_pool.rb:490:in `checkout'
activerecord (5.0.7.2) lib/active_record/connection_adapters/abstract/connection_pool.rb:364:in `connection'
activerecord (5.0.7.2) lib/active_record/connection_adapters/abstract/connection_pool.rb:883:in `retrieve_connection'
activerecord (5.0.7.2) lib/active_record/connection_handling.rb:128:in `retrieve_connection'
activerecord (5.0.7.2) lib/active_record/connection_handling.rb:91:in `connection'
activerecord (5.0.7.2) lib/active_record/migration.rb:559:in `connection'
activerecord (5.0.7.2) lib/active_record/migration.rb:546:in `call'
actionpack (5.0.7.2) lib/action_dispatch/middleware/callbacks.rb:38:in `block in call'
activesupport (5.0.7.2) lib/active_support/callbacks.rb:97:in `__run_callbacks__'
activesupport (5.0.7.2) lib/active_support/callbacks.rb:750:in `_run_call_callbacks'
activesupport (5.0.7.2) lib/active_support/callbacks.rb:90:in `run_callbacks'
actionpack (5.0.7.2) lib/action_dispatch/middleware/callbacks.rb:36:in `call'
actionpack (5.0.7.2) lib/action_dispatch/middleware/executor.rb:12:in `call'
actionpack (5.0.7.2) lib/action_dispatch/middleware/remote_ip.rb:79:in `call'
actionpack (5.0.7.2) lib/action_dispatch/middleware/debug_exceptions.rb:49:in `call'
web-console (3.7.0) lib/web_console/middleware.rb:135:in `call_app'
web-console (3.7.0) lib/web_console/middleware.rb:30:in `block in call'
web-console (3.7.0) lib/web_console/middleware.rb:20:in `catch'
web-console (3.7.0) lib/web_console/middleware.rb:20:in `call'
actionpack (5.0.7.2) lib/action_dispatch/middleware/show_exceptions.rb:31:in `call'
railties (5.0.7.2) lib/rails/rack/logger.rb:36:in `call_app'
railties (5.0.7.2) lib/rails/rack/logger.rb:24:in `block in call'
activesupport (5.0.7.2) lib/active_support/tagged_logging.rb:69:in `block in tagged'
activesupport (5.0.7.2) lib/active_support/tagged_logging.rb:26:in `tagged'
activesupport (5.0.7.2) lib/active_support/tagged_logging.rb:69:in `tagged'
railties (5.0.7.2) lib/rails/rack/logger.rb:24:in `call'
sprockets-rails (3.2.2) lib/sprockets/rails/quiet_assets.rb:13:in `call'
actionpack (5.0.7.2) lib/action_dispatch/middleware/request_id.rb:24:in `call'
rack (2.2.3) lib/rack/method_override.rb:24:in `call'
rack (2.2.3) lib/rack/runtime.rb:22:in `call'
activesupport (5.0.7.2) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
actionpack (5.0.7.2) lib/action_dispatch/middleware/executor.rb:12:in `call'
actionpack (5.0.7.2) lib/action_dispatch/middleware/static.rb:136:in `call'
rack (2.2.3) lib/rack/sendfile.rb:110:in `call'
railties (5.0.7.2) lib/rails/engine.rb:522:in `call'
puma (3.12.6) lib/puma/configuration.rb:227:in `call'
puma (3.12.6) lib/puma/server.rb:706:in `handle_request'
puma (3.12.6) lib/puma/server.rb:476:in `process_client'
puma (3.12.6) lib/puma/server.rb:334:in `block in run'
puma (3.12.6) lib/puma/thread_pool.rb:135:in `block in spawn_thread'

My setup:

ruby 2.6.6p146 (2020-03-31 revision 67876) [x64-mingw32]
Rails 5.0.7.2
Windows 10

Thanks for the help in advance!

Shannarra
  • 521
  • 4
  • 17
  • 1
    Well it is telling you those two arguments you are passing in shouldn't be there. Did you see this setup in a tutorial or something? – Rockwell Rice Nov 06 '20 at 17:30
  • @RockwellRice no, it's the default setup I've been provided from the framework.. Do you know how to fix it? – Shannarra Nov 06 '20 at 18:34
  • 1
    why are you trying to create a database in a codeblock? why not `rails db:create`? what's the usecase? – Yshmarov Nov 06 '20 at 20:23
  • SQLite3::Database actually accepts two arguments (https://github.com/sparklemotion/sqlite3-ruby/blob/master/lib/sqlite3/database.rb#L65). So either you use some outdated sqlite3-ruby gem version or this class is overridden somehow by somebody. Could you provide version of sqlite3-ruby gem? – andrykonchin Nov 06 '20 at 21:15

2 Answers2

0

Solved it!

The problem was not with SQL/sqlite3, but rather with my Gemfile.

Either way, thanks to all of you for the responses and happy coding! :3

Shannarra
  • 521
  • 4
  • 17
-1

Have you migrated your database? Alternatively you can stick with MySQL instead of SQLite.

Here's the documentation for the initialize (.new) method: https://www.rubydoc.info/github/luislavena/sqlite3-ruby/SQLite3/Database

Duarte
  • 11
  • 1