Hi,
I’m running into strange issue when using the action generator with Hanami 2.3. I’ve searched on the github issues for hanami-rspec and here as well, but can’t find nothing similar. I’m guessing it’s again something with my setup.
I’m using Ruby 3.3.2 and Hanami 2.3.
Here are the 3 outputs I get with 3 different commands. It doesn’t matter if I omit the -skipp* options.
The views and the templates get generated, but specs don’t.
On a side note, the getting started guide specifies the `bin/hanami generate` command, while, the docs for generate specify the `bundle exec hanami generate`. The later breaks with a different error, but still breaks.
bin/hanami generate action home.index --skip-route --skip-tests
Created app/actions/home/index.rb
Created app/views/home/index.rb
Created app/templates/home/index.html.erb
/home/sebastjan/.rbenv/versions/3.3.2/lib/ruby/gems/3.3.0/gems/hanami-rspec-2.3.0/lib/hanami/rspec/commands.rb:131:in `call': wrong number of arguments (given 0, expected 1) (ArgumentError)
from /home/sebastjan/.rbenv/versions/3.3.2/lib/ruby/gems/3.3.0/gems/hanami-cli-2.3.3/lib/hanami/cli/commands/app/command.rb:46:in `call'
from /home/sebastjan/.rbenv/versions/3.3.2/lib/ruby/gems/3.3.0/gems/dry-cli-1.4.0/lib/dry/cli/command_registry.rb:258:in `instance_exec'
from /home/sebastjan/.rbenv/versions/3.3.2/lib/ruby/gems/3.3.0/gems/dry-cli-1.4.0/lib/dry/cli/command_registry.rb:258:in `block in run'
from /home/sebastjan/.rbenv/versions/3.3.2/lib/ruby/3.3.0/set.rb:501:in `each_key'
from /home/sebastjan/.rbenv/versions/3.3.2/lib/ruby/3.3.0/set.rb:501:in `each'
from /home/sebastjan/.rbenv/versions/3.3.2/lib/ruby/gems/3.3.0/gems/dry-cli-1.4.0/lib/dry/cli/command_registry.rb:257:in `run'
from /home/sebastjan/.rbenv/versions/3.3.2/lib/ruby/gems/3.3.0/gems/dry-cli-1.4.0/lib/dry/cli.rb:125:in `perform_registry'
from /home/sebastjan/.rbenv/versions/3.3.2/lib/ruby/gems/3.3.0/gems/dry-cli-1.4.0/lib/dry/cli.rb:66:in `call'
from /home/sebastjan/.rbenv/versions/3.3.2/lib/ruby/gems/3.3.0/gems/hanami-cli-2.3.3/exe/hanami:11:in `<top (required)>'
from bin/hanami:27:in `load'
from bin/hanami:27:in `<main>'
bin/hanami generate action home1.index --skip-tests
Updated config/routes.rb
Created app/actions/home1/index.rb
Created app/views/home1/index.rb
Created app/templates/home1/index.html.erb
/home/sebastjan/.rbenv/versions/3.3.2/lib/ruby/gems/3.3.0/gems/hanami-rspec-2.3.0/lib/hanami/rspec/commands.rb:131:in `call': wrong number of arguments (given 0, expected 1) (ArgumentError)
from /home/sebastjan/.rbenv/versions/3.3.2/lib/ruby/gems/3.3.0/gems/hanami-cli-2.3.3/lib/hanami/cli/commands/app/command.rb:46:in `call'
from /home/sebastjan/.rbenv/versions/3.3.2/lib/ruby/gems/3.3.0/gems/dry-cli-1.4.0/lib/dry/cli/command_registry.rb:258:in `instance_exec'
from /home/sebastjan/.rbenv/versions/3.3.2/lib/ruby/gems/3.3.0/gems/dry-cli-1.4.0/lib/dry/cli/command_registry.rb:258:in `block in run'
from /home/sebastjan/.rbenv/versions/3.3.2/lib/ruby/3.3.0/set.rb:501:in `each_key'
from /home/sebastjan/.rbenv/versions/3.3.2/lib/ruby/3.3.0/set.rb:501:in `each'
from /home/sebastjan/.rbenv/versions/3.3.2/lib/ruby/gems/3.3.0/gems/dry-cli-1.4.0/lib/dry/cli/command_registry.rb:257:in `run'
from /home/sebastjan/.rbenv/versions/3.3.2/lib/ruby/gems/3.3.0/gems/dry-cli-1.4.0/lib/dry/cli.rb:125:in `perform_registry'
from /home/sebastjan/.rbenv/versions/3.3.2/lib/ruby/gems/3.3.0/gems/dry-cli-1.4.0/lib/dry/cli.rb:66:in `call'
from /home/sebastjan/.rbenv/versions/3.3.2/lib/ruby/gems/3.3.0/gems/hanami-cli-2.3.3/exe/hanami:11:in `<top (required)>'
from bin/hanami:27:in `load'
from bin/hanami:27:in `<main>'
bin/hanami generate action home2.index
Updated config/routes.rb
Created app/actions/home2/index.rb
Created app/views/home2/index.rb
Created app/templates/home2/index.html.erb
/home/sebastjan/.rbenv/versions/3.3.2/lib/ruby/gems/3.3.0/gems/hanami-rspec-2.3.0/lib/hanami/rspec/commands.rb:131:in `call': wrong number of arguments (given 0, expected 1) (ArgumentError)
from /home/sebastjan/.rbenv/versions/3.3.2/lib/ruby/gems/3.3.0/gems/hanami-cli-2.3.3/lib/hanami/cli/commands/app/command.rb:46:in `call'
from /home/sebastjan/.rbenv/versions/3.3.2/lib/ruby/gems/3.3.0/gems/dry-cli-1.4.0/lib/dry/cli/command_registry.rb:258:in `instance_exec'
from /home/sebastjan/.rbenv/versions/3.3.2/lib/ruby/gems/3.3.0/gems/dry-cli-1.4.0/lib/dry/cli/command_registry.rb:258:in `block in run'
from /home/sebastjan/.rbenv/versions/3.3.2/lib/ruby/3.3.0/set.rb:501:in `each_key'
from /home/sebastjan/.rbenv/versions/3.3.2/lib/ruby/3.3.0/set.rb:501:in `each'
from /home/sebastjan/.rbenv/versions/3.3.2/lib/ruby/gems/3.3.0/gems/dry-cli-1.4.0/lib/dry/cli/command_registry.rb:257:in `run'
from /home/sebastjan/.rbenv/versions/3.3.2/lib/ruby/gems/3.3.0/gems/dry-cli-1.4.0/lib/dry/cli.rb:125:in `perform_registry'
from /home/sebastjan/.rbenv/versions/3.3.2/lib/ruby/gems/3.3.0/gems/dry-cli-1.4.0/lib/dry/cli.rb:66:in `call'
from /home/sebastjan/.rbenv/versions/3.3.2/lib/ruby/gems/3.3.0/gems/hanami-cli-2.3.3/exe/hanami:11:in `<top (required)>'
from bin/hanami:27:in `load'
from bin/hanami:27:in `<main>'
Edit START
Here is the `bundle exec` command error:
bundle exec hanami generate action home3.index --skip-route --skip-tests
Created app/actions/home3/index.rb
Created app/views/home3/index.rb
Created app/templates/home3/index.html.erb
bundler: failed to load command: hanami (/home/sebastjan/.rbenv/versions/3.3.2/bin/hanami)
/home/sebastjan/.rbenv/versions/3.3.2/lib/ruby/gems/3.3.0/gems/hanami-rspec-2.3.0/lib/hanami/rspec/commands.rb:131:in `call': wrong number of arguments (given 0, expected 1) (ArgumentError)
from /home/sebastjan/.rbenv/versions/3.3.2/lib/ruby/gems/3.3.0/gems/hanami-cli-2.3.3/lib/hanami/cli/commands/app/command.rb:46:in `call'
from /home/sebastjan/.rbenv/versions/3.3.2/lib/ruby/gems/3.3.0/gems/dry-cli-1.4.0/lib/dry/cli/command_registry.rb:258:in `instance_exec'
from /home/sebastjan/.rbenv/versions/3.3.2/lib/ruby/gems/3.3.0/gems/dry-cli-1.4.0/lib/dry/cli/command_registry.rb:258:in `block in run'
from /home/sebastjan/.rbenv/versions/3.3.2/lib/ruby/3.3.0/set.rb:501:in `each_key'
from /home/sebastjan/.rbenv/versions/3.3.2/lib/ruby/3.3.0/set.rb:501:in `each'
from /home/sebastjan/.rbenv/versions/3.3.2/lib/ruby/gems/3.3.0/gems/dry-cli-1.4.0/lib/dry/cli/command_registry.rb:257:in `run'
from /home/sebastjan/.rbenv/versions/3.3.2/lib/ruby/gems/3.3.0/gems/dry-cli-1.4.0/lib/dry/cli.rb:125:in `perform_registry'
from /home/sebastjan/.rbenv/versions/3.3.2/lib/ruby/gems/3.3.0/gems/dry-cli-1.4.0/lib/dry/cli.rb:66:in `call'
from /home/sebastjan/.rbenv/versions/3.3.2/lib/ruby/gems/3.3.0/gems/hanami-cli-2.3.3/exe/hanami:11:in `<top (required)>'
from /home/sebastjan/.rbenv/versions/3.3.2/bin/hanami:25:in `load'
from /home/sebastjan/.rbenv/versions/3.3.2/bin/hanami:25:in `<top (required)>'
from /home/sebastjan/.rbenv/versions/3.3.2/lib/ruby/3.3.0/bundler/cli/exec.rb:58:in `load'
from /home/sebastjan/.rbenv/versions/3.3.2/lib/ruby/3.3.0/bundler/cli/exec.rb:58:in `kernel_load'
from /home/sebastjan/.rbenv/versions/3.3.2/lib/ruby/3.3.0/bundler/cli/exec.rb:23:in `run'
from /home/sebastjan/.rbenv/versions/3.3.2/lib/ruby/3.3.0/bundler/cli.rb:451:in `exec'
from /home/sebastjan/.rbenv/versions/3.3.2/lib/ruby/3.3.0/bundler/vendor/thor/lib/thor/command.rb:28:in `run'
from /home/sebastjan/.rbenv/versions/3.3.2/lib/ruby/3.3.0/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
from /home/sebastjan/.rbenv/versions/3.3.2/lib/ruby/3.3.0/bundler/vendor/thor/lib/thor.rb:527:in `dispatch'
from /home/sebastjan/.rbenv/versions/3.3.2/lib/ruby/3.3.0/bundler/cli.rb:34:in `dispatch'
from /home/sebastjan/.rbenv/versions/3.3.2/lib/ruby/3.3.0/bundler/vendor/thor/lib/thor/base.rb:584:in `start'
from /home/sebastjan/.rbenv/versions/3.3.2/lib/ruby/3.3.0/bundler/cli.rb:28:in `start'
from /home/sebastjan/.rbenv/versions/3.3.2/lib/ruby/gems/3.3.0/gems/bundler-2.5.9/exe/bundle:28:in `block in <top (required)>'
from /home/sebastjan/.rbenv/versions/3.3.2/lib/ruby/3.3.0/bundler/friendly_errors.rb:117:in `with_friendly_errors'
from /home/sebastjan/.rbenv/versions/3.3.2/lib/ruby/gems/3.3.0/gems/bundler-2.5.9/exe/bundle:20:in `<top (required)>'
from /home/sebastjan/.rbenv/versions/3.3.2/bin/bundle:25:in `load'
from /home/sebastjan/.rbenv/versions/3.3.2/bin/bundle:25:in `<main>'
Edit End
Any ideas about the cause for these?
Thank you. seba