Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot use Tapioca with Rails 8 solid_cache on postgresql #2141

Closed
alexanderholder opened this issue Jan 7, 2025 · 1 comment
Closed

Cannot use Tapioca with Rails 8 solid_cache on postgresql #2141

alexanderholder opened this issue Jan 7, 2025 · 1 comment

Comments

@alexanderholder
Copy link

When using Tapioca (gems or init) on a default Rails 8 project using solid cache on postgresql, the below error is thrown. I've done a bit of looking around but I'm not sure I am on the correct path, but the draft PR for #2004 seems to correctly load the database config for Ruby 3.3.6 but still fails on Ruby 3.4.1.

Rails 8.0.1
Ruby 3.3.6

Generating RBI files of gems that are added or updated:

Requiring all gems to prepare for compiling... /.rvm/gems/ruby-3.3.6/gems/activerecord-8.0.1/lib/active_record/database_configurations.rb:229:in `resolve_symbol_connection': The `cache` database is not configured for the `development` environment. (ActiveRecord::AdapterNotSpecified)

  Available database configurations are:

  

        from /.rvm/gems/ruby-3.3.6/gems/activerecord-8.0.1/lib/active_record/database_configurations.rb:179:in `resolve'
        from /.rvm/gems/ruby-3.3.6/gems/activerecord-8.0.1/lib/active_record/connection_handling.rb:391:in `resolve_config_for_connection'
        from /.rvm/gems/ruby-3.3.6/gems/activerecord-8.0.1/lib/active_record/connection_handling.rb:100:in `block (2 levels) in connects_to'
        from /.rvm/gems/ruby-3.3.6/gems/activerecord-8.0.1/lib/active_record/connection_handling.rb:99:in `each'
        from /.rvm/gems/ruby-3.3.6/gems/activerecord-8.0.1/lib/active_record/connection_handling.rb:99:in `block in connects_to'
        from /.rvm/gems/ruby-3.3.6/gems/activerecord-8.0.1/lib/active_record/connection_handling.rb:98:in `each'
        from /.rvm/gems/ruby-3.3.6/gems/activerecord-8.0.1/lib/active_record/connection_handling.rb:98:in `connects_to'
        from /.rvm/gems/ruby-3.3.6/gems/solid_cache-1.0.6/app/models/solid_cache/record.rb:9:in `<class:Record>'
        from /.rvm/gems/ruby-3.3.6/gems/solid_cache-1.0.6/app/models/solid_cache/record.rb:4:in `<module:SolidCache>'
        from /.rvm/gems/ruby-3.3.6/gems/solid_cache-1.0.6/app/models/solid_cache/record.rb:3:in `<main>'
        from /.rvm/rubies/ruby-3.3.6/lib/ruby/3.3.0/bundled_gems.rb:69:in `require'
        from /.rvm/rubies/ruby-3.3.6/lib/ruby/3.3.0/bundled_gems.rb:69:in `block (2 levels) in replace_require'
        from /.rvm/gems/ruby-3.3.6/gems/bootsnap-1.18.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
        from /.rvm/gems/ruby-3.3.6/gems/zeitwerk-2.7.1/lib/zeitwerk/core_ext/kernel.rb:26:in `require'
        from /.rvm/gems/ruby-3.3.6/gems/solid_cache-1.0.6/app/models/solid_cache/entry.rb:4:in `<module:SolidCache>'
        from /.rvm/gems/ruby-3.3.6/gems/solid_cache-1.0.6/app/models/solid_cache/entry.rb:3:in `<main>'
        from /.rvm/rubies/ruby-3.3.6/lib/ruby/3.3.0/bundled_gems.rb:69:in `require'
        from /.rvm/rubies/ruby-3.3.6/lib/ruby/3.3.0/bundled_gems.rb:69:in `block (2 levels) in replace_require'
        from /.rvm/gems/ruby-3.3.6/gems/bootsnap-1.18.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
        from /.rvm/gems/ruby-3.3.6/gems/zeitwerk-2.7.1/lib/zeitwerk/core_ext/kernel.rb:26:in `require'
        from /.rvm/gems/ruby-3.3.6/gems/tapioca-0.16.6/lib/tapioca/runtime/reflection.rb:50:in `const_get'
        from /.rvm/gems/ruby-3.3.6/gems/tapioca-0.16.6/lib/tapioca/runtime/reflection.rb:50:in `constantize'
        from /.rvm/gems/ruby-3.3.6/gems/tapioca-0.16.6/lib/tapioca/runtime/trackers/autoload.rb:25:in `block in eager_load_all!'
        from /.rvm/gems/ruby-3.3.6/gems/tapioca-0.16.6/lib/tapioca/runtime/trackers/autoload.rb:50:in `with_disabled_exits'
        from /.rvm/gems/ruby-3.3.6/gems/sorbet-runtime-0.5.11718/lib/types/private/methods/_methods.rb:279:in `bind_call'
        from /.rvm/gems/ruby-3.3.6/gems/sorbet-runtime-0.5.11718/lib/types/private/methods/_methods.rb:279:in `block in _on_method_added'
        from /.rvm/gems/ruby-3.3.6/gems/tapioca-0.16.6/lib/tapioca/runtime/trackers/autoload.rb:20:in `eager_load_all!'
        from /.rvm/gems/ruby-3.3.6/gems/sorbet-runtime-0.5.11718/lib/types/private/methods/_methods.rb:279:in `bind_call'
        from /.rvm/gems/ruby-3.3.6/gems/sorbet-runtime-0.5.11718/lib/types/private/methods/_methods.rb:279:in `block in _on_method_added'
        from /.rvm/gems/ruby-3.3.6/gems/tapioca-0.16.6/lib/tapioca/loaders/gem.rb:69:in `require_gem_file'
        from /.rvm/gems/ruby-3.3.6/gems/sorbet-runtime-0.5.11718/lib/types/private/methods/_methods.rb:279:in `bind_call'
        from /.rvm/gems/ruby-3.3.6/gems/sorbet-runtime-0.5.11718/lib/types/private/methods/_methods.rb:279:in `block in _on_method_added'
        from /.rvm/gems/ruby-3.3.6/gems/tapioca-0.16.6/lib/tapioca/loaders/gem.rb:35:in `load'
        from /.rvm/gems/ruby-3.3.6/gems/sorbet-runtime-0.5.11718/lib/types/private/methods/_methods.rb:279:in `bind_call'
        from /.rvm/gems/ruby-3.3.6/gems/sorbet-runtime-0.5.11718/lib/types/private/methods/_methods.rb:279:in `block in _on_method_added'
        from /.rvm/gems/ruby-3.3.6/gems/tapioca-0.16.6/lib/tapioca/loaders/gem.rb:29:in `load_application'
        from /.rvm/gems/ruby-3.3.6/gems/sorbet-runtime-0.5.11718/lib/types/private/methods/_methods.rb:279:in `bind_call'
        from /.rvm/gems/ruby-3.3.6/gems/sorbet-runtime-0.5.11718/lib/types/private/methods/_methods.rb:279:in `block in _on_method_added'
        from /.rvm/gems/ruby-3.3.6/gems/tapioca-0.16.6/lib/tapioca/commands/abstract_gem.rb:159:in `block in perform_additions'
        from /.rvm/gems/ruby-3.3.6/gems/thor-1.3.2/lib/thor/shell/basic.rb:46:in `indent'
        from /.rvm/gems/ruby-3.3.6/gems/tapioca-0.16.6/lib/tapioca/commands/abstract_gem.rb:155:in `perform_additions'
        from /.rvm/gems/ruby-3.3.6/gems/sorbet-runtime-0.5.11718/lib/types/private/methods/_methods.rb:279:in `bind_call'
        from /.rvm/gems/ruby-3.3.6/gems/sorbet-runtime-0.5.11718/lib/types/private/methods/_methods.rb:279:in `block in _on_method_added'
        from /.rvm/gems/ruby-3.3.6/gems/tapioca-0.16.6/lib/tapioca/commands/gem_sync.rb:13:in `execute'
        from /.rvm/gems/ruby-3.3.6/gems/sorbet-runtime-0.5.11718/lib/types/private/methods/_methods.rb:279:in `bind_call'
        from /.rvm/gems/ruby-3.3.6/gems/sorbet-runtime-0.5.11718/lib/types/private/methods/_methods.rb:279:in `block in _on_method_added'
        from /.rvm/gems/ruby-3.3.6/gems/tapioca-0.16.6/lib/tapioca/commands/command.rb:27:in `block in run'
        from /.rvm/gems/ruby-3.3.6/gems/tapioca-0.16.6/lib/tapioca.rb:24:in `block in silence_warnings'
        from /.rvm/rubies/ruby-3.3.6/lib/ruby/3.3.0/rubygems/user_interaction.rb:46:in `use_ui'
        from /.rvm/gems/ruby-3.3.6/gems/tapioca-0.16.6/lib/tapioca.rb:23:in `silence_warnings'
        from /.rvm/gems/ruby-3.3.6/gems/tapioca-0.16.6/lib/tapioca/commands/command.rb:26:in `run'
        from /.rvm/gems/ruby-3.3.6/gems/tapioca-0.16.6/lib/tapioca/cli.rb:319:in `gem'
        from /.rvm/gems/ruby-3.3.6/gems/thor-1.3.2/lib/thor/command.rb:28:in `run'
        from /.rvm/gems/ruby-3.3.6/gems/thor-1.3.2/lib/thor/invocation.rb:127:in `invoke_command'
        from /.rvm/gems/ruby-3.3.6/gems/thor-1.3.2/lib/thor.rb:538:in `dispatch'
        from /.rvm/gems/ruby-3.3.6/gems/thor-1.3.2/lib/thor/invocation.rb:116:in `invoke'
        from /.rvm/gems/ruby-3.3.6/gems/tapioca-0.16.6/lib/tapioca/cli.rb:32:in `block in init'
        from /.rvm/gems/ruby-3.3.6/gems/tapioca-0.16.6/lib/tapioca/runtime/trackers.rb:26:in `with_trackers_enabled'
        from /.rvm/gems/ruby-3.3.6/gems/sorbet-runtime-0.5.11718/lib/types/private/methods/_methods.rb:279:in `bind_call'
        from /.rvm/gems/ruby-3.3.6/gems/sorbet-runtime-0.5.11718/lib/types/private/methods/_methods.rb:279:in `block in _on_method_added'
        from /.rvm/gems/ruby-3.3.6/gems/tapioca-0.16.6/lib/tapioca/cli.rb:29:in `init'
        from /.rvm/gems/ruby-3.3.6/gems/thor-1.3.2/lib/thor/command.rb:28:in `run'
        from /.rvm/gems/ruby-3.3.6/gems/thor-1.3.2/lib/thor/invocation.rb:127:in `invoke_command'
        from /.rvm/gems/ruby-3.3.6/gems/thor-1.3.2/lib/thor.rb:538:in `dispatch'
        from /.rvm/gems/ruby-3.3.6/gems/thor-1.3.2/lib/thor/base.rb:584:in `start'
        from /.rvm/gems/ruby-3.3.6/gems/tapioca-0.16.6/exe/tapioca:30:in `<top (required)>'
        from /.rvm/gems/ruby-3.3.6/bin/tapioca:25:in `load'
        from /.rvm/gems/ruby-3.3.6/bin/tapioca:25:in `<main>'
        from /.rvm/gems/ruby-3.3.6/bin/ruby_executable_hooks:22:in `eval'
        from /.rvm/gems/ruby-3.3.6/bin/ruby_executable_hooks:22:in `<main>'
@alexanderholder alexanderholder changed the title Cannot use Tapioca with solid_cache on postgresql Cannot use Tapioca with Rails 8 solid_cache on postgresql Jan 7, 2025
@alexanderholder
Copy link
Author

Found this, will close this issue: #2080

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant