dry-rb/dry-validation

Wrong number of arguments

Closed this issue · 3 comments

Hello! When I try to start my Rails application, I get the following error:

2024-07-04 12:11:19 /usr/local/bundle/gems/dry-types-0.14.1/lib/dry/types/definition.rb:30:in `initialize': wrong number of arguments (given 2, expected 1) (ArgumentError)
2024-07-04 12:11:19     from /usr/local/bundle/gems/dry-types-0.14.1/lib/dry/types/any.rb:5:in `initialize'
2024-07-04 12:11:19     from /usr/local/bundle/gems/dry-types-0.14.1/lib/dry/types/any.rb:25:in `new'
2024-07-04 12:11:19     from /usr/local/bundle/gems/dry-types-0.14.1/lib/dry/types/any.rb:25:in `<module:Types>'
2024-07-04 12:11:19     from /usr/local/bundle/gems/dry-types-0.14.1/lib/dry/types/any.rb:2:in `<module:Dry>'
2024-07-04 12:11:19     from /usr/local/bundle/gems/dry-types-0.14.1/lib/dry/types/any.rb:1:in `<top (required)>'
2024-07-04 12:11:19     from /usr/local/bundle/gems/activesupport-6.1.7.8/lib/active_support/dependencies.rb:332:in `require'
2024-07-04 12:11:19     from /usr/local/bundle/gems/activesupport-6.1.7.8/lib/active_support/dependencies.rb:332:in `block in require'
2024-07-04 12:11:19     from /usr/local/bundle/gems/activesupport-6.1.7.8/lib/active_support/dependencies.rb:299:in `load_dependency'
2024-07-04 12:11:19     from /usr/local/bundle/gems/activesupport-6.1.7.8/lib/active_support/dependencies.rb:332:in `require'
2024-07-04 12:11:19     from /usr/local/bundle/gems/dry-types-0.14.1/lib/dry/types/core.rb:1:in `<top (required)>'
2024-07-04 12:11:19     from /usr/local/bundle/gems/activesupport-6.1.7.8/lib/active_support/dependencies.rb:332:in `require'
2024-07-04 12:11:19     from /usr/local/bundle/gems/activesupport-6.1.7.8/lib/active_support/dependencies.rb:332:in `block in require'
2024-07-04 12:11:19     from /usr/local/bundle/gems/activesupport-6.1.7.8/lib/active_support/dependencies.rb:299:in `load_dependency'
2024-07-04 12:11:19     from /usr/local/bundle/gems/activesupport-6.1.7.8/lib/active_support/dependencies.rb:332:in `require'
2024-07-04 12:11:19     from /usr/local/bundle/gems/dry-types-0.14.1/lib/dry/types.rb:152:in `<top (required)>'
2024-07-04 12:11:19     from /usr/local/bundle/gems/activesupport-6.1.7.8/lib/active_support/dependencies.rb:332:in `require'
2024-07-04 12:11:19     from /usr/local/bundle/gems/activesupport-6.1.7.8/lib/active_support/dependencies.rb:332:in `block in require'
2024-07-04 12:11:19     from /usr/local/bundle/gems/activesupport-6.1.7.8/lib/active_support/dependencies.rb:299:in `load_dependency'
2024-07-04 12:11:19     from /usr/local/bundle/gems/activesupport-6.1.7.8/lib/active_support/dependencies.rb:332:in `require'
2024-07-04 12:11:19     from /usr/local/bundle/gems/dry-validation-0.13.3/lib/dry/validation/input_processor_compiler.rb:1:in `<top (required)>'
2024-07-04 12:11:19     from /usr/local/bundle/gems/activesupport-6.1.7.8/lib/active_support/dependencies.rb:332:in `require'
2024-07-04 12:11:19     from /usr/local/bundle/gems/activesupport-6.1.7.8/lib/active_support/dependencies.rb:332:in `block in require'
2024-07-04 12:11:19     from /usr/local/bundle/gems/activesupport-6.1.7.8/lib/active_support/dependencies.rb:299:in `load_dependency'
2024-07-04 12:11:19     from /usr/local/bundle/gems/activesupport-6.1.7.8/lib/active_support/dependencies.rb:332:in `require'
2024-07-04 12:11:19     from /usr/local/bundle/gems/dry-validation-0.13.3/lib/dry/validation/schema/deprecated.rb:1:in `<top (required)>'
2024-07-04 12:11:19     from /usr/local/bundle/gems/activesupport-6.1.7.8/lib/active_support/dependencies.rb:332:in `require'
2024-07-04 12:11:19     from /usr/local/bundle/gems/activesupport-6.1.7.8/lib/active_support/dependencies.rb:332:in `block in require'
2024-07-04 12:11:19     from /usr/local/bundle/gems/activesupport-6.1.7.8/lib/active_support/dependencies.rb:299:in `load_dependency'
2024-07-04 12:11:19     from /usr/local/bundle/gems/activesupport-6.1.7.8/lib/active_support/dependencies.rb:332:in `require'
2024-07-04 12:11:19     from /usr/local/bundle/gems/dry-validation-0.13.3/lib/dry/validation/schema.rb:14:in `<top (required)>'
2024-07-04 12:11:19     from /usr/local/bundle/gems/activesupport-6.1.7.8/lib/active_support/dependencies.rb:332:in `require'
2024-07-04 12:11:19     from /usr/local/bundle/gems/activesupport-6.1.7.8/lib/active_support/dependencies.rb:332:in `block in require'
2024-07-04 12:11:19     from /usr/local/bundle/gems/activesupport-6.1.7.8/lib/active_support/dependencies.rb:299:in `load_dependency'
2024-07-04 12:11:19     from /usr/local/bundle/gems/activesupport-6.1.7.8/lib/active_support/dependencies.rb:332:in `require'
2024-07-04 12:11:19     from /usr/local/bundle/gems/dry-validation-0.13.3/lib/dry/validation.rb:39:in `<top (required)>'
2024-07-04 12:11:19     from /usr/local/bundle/gems/activesupport-6.1.7.8/lib/active_support/dependencies.rb:332:in `require'
2024-07-04 12:11:19     from /usr/local/bundle/gems/activesupport-6.1.7.8/lib/active_support/dependencies.rb:332:in `block in require'
2024-07-04 12:11:19     from /usr/local/bundle/gems/activesupport-6.1.7.8/lib/active_support/dependencies.rb:299:in `load_dependency'
2024-07-04 12:11:19     from /usr/local/bundle/gems/activesupport-6.1.7.8/lib/active_support/dependencies.rb:332:in `require'
2024-07-04 12:11:19     from /usr/local/bundle/gems/dry-validation-0.13.3/lib/dry-validation.rb:1:in `<top (required)>'
2024-07-04 12:11:19     from /usr/local/bundle/gems/bundler-2.4.22/lib/bundler/runtime.rb:60:in `require'
2024-07-04 12:11:19     from /usr/local/bundle/gems/bundler-2.4.22/lib/bundler/runtime.rb:60:in `block (2 levels) in require'
2024-07-04 12:11:19     from /usr/local/bundle/gems/bundler-2.4.22/lib/bundler/runtime.rb:55:in `each'
2024-07-04 12:11:19     from /usr/local/bundle/gems/bundler-2.4.22/lib/bundler/runtime.rb:55:in `block in require'
2024-07-04 12:11:19     from /usr/local/bundle/gems/bundler-2.4.22/lib/bundler/runtime.rb:44:in `each'
2024-07-04 12:11:19     from /usr/local/bundle/gems/bundler-2.4.22/lib/bundler/runtime.rb:44:in `require'
2024-07-04 12:11:19     from /usr/local/bundle/gems/bundler-2.4.22/lib/bundler.rb:187:in `require'
2024-07-04 12:11:19     from /portal/config/application.rb:12:in `<top (required)>'
2024-07-04 12:11:19     from /usr/local/bundle/gems/activesupport-6.1.7.8/lib/active_support/dependencies.rb:332:in `require'
2024-07-04 12:11:19     from /usr/local/bundle/gems/activesupport-6.1.7.8/lib/active_support/dependencies.rb:332:in `block in require'
2024-07-04 12:11:19     from /usr/local/bundle/gems/activesupport-6.1.7.8/lib/active_support/dependencies.rb:299:in `load_dependency'
2024-07-04 12:11:19     from /usr/local/bundle/gems/activesupport-6.1.7.8/lib/active_support/dependencies.rb:332:in `require'
2024-07-04 12:11:19     from /usr/local/bundle/gems/railties-6.1.7.8/lib/rails/commands/server/server_command.rb:138:in `block in perform'
2024-07-04 12:11:19     from <internal:kernel>:90:in `tap'
2024-07-04 12:11:19     from /usr/local/bundle/gems/railties-6.1.7.8/lib/rails/commands/server/server_command.rb:135:in `perform'
2024-07-04 12:11:19     from /usr/local/bundle/gems/thor-1.3.1/lib/thor/command.rb:28:in `run'
2024-07-04 12:11:19     from /usr/local/bundle/gems/thor-1.3.1/lib/thor/invocation.rb:127:in `invoke_command'
2024-07-04 12:11:19     from /usr/local/bundle/gems/thor-1.3.1/lib/thor.rb:527:in `dispatch'
2024-07-04 12:11:19     from /usr/local/bundle/gems/railties-6.1.7.8/lib/rails/command/base.rb:69:in `perform'
2024-07-04 12:11:19     from /usr/local/bundle/gems/railties-6.1.7.8/lib/rails/command.rb:48:in `invoke'
2024-07-04 12:11:19     from /usr/local/bundle/gems/railties-6.1.7.8/lib/rails/commands.rb:18:in `<top (required)>'
2024-07-04 12:11:19     from bin/rails:12:in `require'
2024-07-04 12:11:19     from bin/rails:12:in `<main>'


Is version 0.13.3 compatible with Ruby 3.1 and if so, what could be the reason for this error?

  • Rails 6.1.7.8
  • Ruby version: 3.1.6
  • OS: Ubuntu 24.04

dry-validation 0.13.3 was released in May 2019 and Ruby 3.1 was released in December 2021 so, no they are not compatible. dry-validation 0.13.3 was tested against Ruby 2.6 and 2.7 when it was developed.

Can you upgrade to the latest version? The CHANGELOG.md is well documented and should help you address any breaking changing

2024-07-04 12:11:19 /usr/local/bundle/gems/dry-types-0.14.1/lib/dry/types/definition.rb:30:in initialize': wrong number of arguments (given 2, expected 1) (ArgumentError) 2024-07-04 12:11:19 from /usr/local/bundle/gems/dry-types-0.14.1/lib/dry/types/any.rb:5:in initialize'
2024-07-04 12:11:19 from /usr/local/bundle/gems/dry-types-0.14.1/lib/dry/types/any.rb:25:in new' 2024-07-04 12:11:19 from /usr/local/bundle/gems/dry-types-0.14.1/lib/dry/types/any.rb:25:in module:Types'
2024-07-04 12:11:19 from /usr/local/bundle/gems/dry-types-0.14.1/lib/dry/types/any.rb:2:in <module:Dry>' 2024-07-04 12:11:19 from /usr/local/bundle/gems/dry-types-0.14.1/lib/dry/types/any.rb:1:in <top (required)>'
2024-07-04 12:11:19 from /usr/local/bundle/gems/activesupport-6.1.7.8/lib/active_support/dependencies.rb:332:in require' 2024-07-04 12:11:19 from /usr/local/bundle/gems/activesupport-6.1.7.8/lib/active_support/dependencies.rb:332:in block in require'
2024-07-04 12:11:19 from /usr/local/bundle/gems/activesupport-6.1.7.8/lib/active_support/dependencies.rb:299:in load_dependency' 2024-07-04 12:11:19 from /usr/local/bundle/gems/activesupport-6.1.7.8/lib/active_support/dependencies.rb:332:in require'
2024-07-04 12:11:19 from /usr/local/bundle/gems/dry-types-0.14.1/lib/dry/types/core.rb:1:in <top (required)>' 2024-07-04 12:11:19 from /usr/local/bundle/gems/activesupport-6.1.7.8/lib/active_support/dependencies.rb:332:in require'
2024-07-04 12:11:19 from /usr/local/bundle/gems/activesupport-6.1.7.8/lib/active_support/dependencies.rb:332:in block in require' 2024-07-04 12:11:19 from /usr/local/bundle/gems/activesupport-6.1.7.8/lib/active_support/dependencies.rb:299:in load_dependency'
2024-07-04 12:11:19 from /usr/local/bundle/gems/activesupport-6.1.7.8/lib/active_support/dependencies.rb:332:in require' 2024-07-04 12:11:19 from /usr/local/bundle/gems/dry-types-0.14.1/lib/dry/types.rb:152:in <top (required)>'
2024-07-04 12:11:19 from /usr/local/bundle/gems/activesupport-6.1.7.8/lib/active_support/dependencies.rb:332:in require' 2024-07-04 12:11:19 from /usr/local/bundle/gems/activesupport-6.1.7.8/lib/active_support/dependencies.rb:332:in block in require'
2024-07-04 12:11:19 from /usr/local/bundle/gems/activesupport-6.1.7.8/lib/active_support/dependencies.rb:299:in load_dependency' 2024-07-04 12:11:19 from /usr/local/bundle/gems/activesupport-6.1.7.8/lib/active_support/dependencies.rb:332:in require'
2024-07-04 12:11:19 from /usr/local/bundle/gems/dry-validation-0.13.3/lib/dry/validation/input_processor_compiler.rb:1:in <top (required)>' 2024-07-04 12:11:19 from /usr/local/bundle/gems/activesupport-6.1.7.8/lib/active_support/dependencies.rb:332:in require'
2024-07-04 12:11:19 from /usr/local/bundle/gems/activesupport-6.1.7.8/lib/active_support/dependencies.rb:332:in block in require' 2024-07-04 12:11:19 from /usr/local/bundle/gems/activesupport-6.1.7.8/lib/active_support/dependencies.rb:299:in load_dependency'
2024-07-04 12:11:19 from /usr/local/bundle/gems/activesupport-6.1.7.8/lib/active_support/dependencies.rb:332:in require' 2024-07-04 12:11:19 from /usr/local/bundle/gems/dry-validation-0.13.3/lib/dry/validation/schema/deprecated.rb:1:in <top (required)>'
2024-07-04 12:11:19 from /usr/local/bundle/gems/activesupport-6.1.7.8/lib/active_support/dependencies.rb:332:in require' 2024-07-04 12:11:19 from /usr/local/bundle/gems/activesupport-6.1.7.8/lib/active_support/dependencies.rb:332:in block in require'
2024-07-04 12:11:19 from /usr/local/bundle/gems/activesupport-6.1.7.8/lib/active_support/dependencies.rb:299:in load_dependency' 2024-07-04 12:11:19 from /usr/local/bundle/gems/activesupport-6.1.7.8/lib/active_support/dependencies.rb:332:in require'
2024-07-04 12:11:19 from /usr/local/bundle/gems/dry-validation-0.13.3/lib/dry/validation/schema.rb:14:in <top (required)>' 2024-07-04 12:11:19 from /usr/local/bundle/gems/activesupport-6.1.7.8/lib/active_support/dependencies.rb:332:in require'
2024-07-04 12:11:19 from /usr/local/bundle/gems/activesupport-6.1.7.8/lib/active_support/dependencies.rb:332:in block in require' 2024-07-04 12:11:19 from /usr/local/bundle/gems/activesupport-6.1.7.8/lib/active_support/dependencies.rb:299:in load_dependency'
2024-07-04 12:11:19 from /usr/local/bundle/gems/activesupport-6.1.7.8/lib/active_support/dependencies.rb:332:in require' 2024-07-04 12:11:19 from /usr/local/bundle/gems/dry-validation-0.13.3/lib/dry/validation.rb:39:in <top (required)>'
2024-07-04 12:11:19 from /usr/local/bundle/gems/activesupport-6.1.7.8/lib/active_support/dependencies.rb:332:in require' 2024-07-04 12:11:19 from /usr/local/bundle/gems/activesupport-6.1.7.8/lib/active_support/dependencies.rb:332:in block in require'
2024-07-04 12:11:19 from /usr/local/bundle/gems/activesupport-6.1.7.8/lib/active_support/dependencies.rb:299:in load_dependency' 2024-07-04 12:11:19 from /usr/local/bundle/gems/activesupport-6.1.7.8/lib/active_support/dependencies.rb:332:in require'
2024-07-04 12:11:19 from /usr/local/bundle/gems/dry-validation-0.13.3/lib/dry-validation.rb:1:in <top (required)>' 2024-07-04 12:11:19 from /usr/local/bundle/gems/bundler-2.4.22/lib/bundler/runtime.rb:60:in require'
2024-07-04 12:11:19 from /usr/local/bundle/gems/bundler-2.4.22/lib/bundler/runtime.rb:60:in block (2 levels) in require' 2024-07-04 12:11:19 from /usr/local/bundle/gems/bundler-2.4.22/lib/bundler/runtime.rb:55:in each'
2024-07-04 12:11:19 from /usr/local/bundle/gems/bundler-2.4.22/lib/bundler/runtime.rb:55:in block in require' 2024-07-04 12:11:19 from /usr/local/bundle/gems/bundler-2.4.22/lib/bundler/runtime.rb:44:in each'
2024-07-04 12:11:19 from /usr/local/bundle/gems/bundler-2.4.22/lib/bundler/runtime.rb:44:in require' 2024-07-04 12:11:19 from /usr/local/bundle/gems/bundler-2.4.22/lib/bundler.rb:187:in require'
2024-07-04 12:11:19 from /portal/config/application.rb:12:in <top (required)>' 2024-07-04 12:11:19 from /usr/local/bundle/gems/activesupport-6.1.7.8/lib/active_support/dependencies.rb:332:in require'
2024-07-04 12:11:19 from /usr/local/bundle/gems/activesupport-6.1.7.8/lib/active_support/dependencies.rb:332:in block in require' 2024-07-04 12:11:19 from /usr/local/bundle/gems/activesupport-6.1.7.8/lib/active_support/dependencies.rb:299:in load_dependency'
2024-07-04 12:11:19 from /usr/local/bundle/gems/activesupport-6.1.7.8/lib/active_support/dependencies.rb:332:in require' 2024-07-04 12:11:19 from /usr/local/bundle/gems/railties-6.1.7.8/lib/rails/commands/server/server_command.rb:138:in block in perform'
2024-07-04 12:11:19 from internal:kernel:90:in tap' 2024-07-04 12:11:19 from /usr/local/bundle/gems/railties-6.1.7.8/lib/rails/commands/server/server_command.rb:135:in perform'
2024-07-04 12:11:19 from /usr/local/bundle/gems/thor-1.3.1/lib/thor/command.rb:28:in run' 2024-07-04 12:11:19 from /usr/local/bundle/gems/thor-1.3.1/lib/thor/invocation.rb:127:in invoke_command'
2024-07-04 12:11:19 from /usr/local/bundle/gems/thor-1.3.1/lib/thor.rb:527:in dispatch' 2024-07-04 12:11:19 from /usr/local/bundle/gems/railties-6.1.7.8/lib/rails/command/base.rb:69:in perform'
2024-07-04 12:11:19 from /usr/local/bundle/gems/railties-6.1.7.8/lib/rails/command.rb:48:in invoke' 2024-07-04 12:11:19 from /usr/local/bundle/gems/railties-6.1.7.8/lib/rails/commands.rb:18:in <top (required)>'
2024-07-04 12:11:19 from bin/rails:12:in require' 2024-07-04 12:11:19 from bin/rails:12:in

'

thank you guys