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

"Wrong number of argumants" error whn running install #102

Closed
vbujas opened this issue Oct 10, 2022 · 1 comment
Closed

"Wrong number of argumants" error whn running install #102

vbujas opened this issue Oct 10, 2022 · 1 comment

Comments

@vbujas
Copy link

vbujas commented Oct 10, 2022

I am getting the "wrong number of arguments (given 3, expected 1..2)" error when trying to run the install command (rails g spree_globalize:install)

Rails version: 6.1.4
Spree version: 4.4.0

Steps to recreate:

  1. Install the spree_starter from: https://github.com/spree/spree_starter with bin/setup-no-docker option
  2. On the clean spree install, add the spree globalize gem and try to run rails g spree_globalize:install

Here is a part of the stack trace:

**home/vladan/.rvm/gems/ruby-3.0.3/gems/activerecord-6.1.4.4/lib/active_record/associations.rb:1457:in has_many': wrong number of arguments (given 3, expected 1..2) (ArgumentError)** from /home/vladan/.rvm/gems/ruby-3.0.3/gems/friendly_id-globalize-1.0.0.alpha3/lib/friendly_id/history.rb:73:in block in included'
from /home/vladan/.rvm/gems/ruby-3.0.3/gems/friendly_id-globalize-1.0.0.alpha3/lib/friendly_id/history.rb:72:in class_eval' from /home/vladan/.rvm/gems/ruby-3.0.3/gems/friendly_id-globalize-1.0.0.alpha3/lib/friendly_id/history.rb:72:in included'
from /home/vladan/.rvm/gems/ruby-3.0.3/gems/friendly_id-5.4.2/lib/friendly_id/configuration.rb:57:in include' from /home/vladan/.rvm/gems/ruby-3.0.3/gems/friendly_id-5.4.2/lib/friendly_id/configuration.rb:57:in block in use'
from /home/vladan/.rvm/gems/ruby-3.0.3/gems/friendly_id-5.4.2/lib/friendly_id/configuration.rb:54:in map' from /home/vladan/.rvm/gems/ruby-3.0.3/gems/friendly_id-5.4.2/lib/friendly_id/configuration.rb:54:in use'
from /home/vladan/.rvm/gems/ruby-3.0.3/gems/friendly_id-5.4.2/lib/friendly_id/base.rb:210:in friendly_id' from /home/vladan/.rvm/gems/ruby-3.0.3/gems/spree_core-4.4.0/app/models/spree/product.rb:33:in class:Product'
from /home/vladan/.rvm/gems/ruby-3.0.3/gems/spree_core-4.4.0/app/models/spree/product.rb:22:in <module:Spree>' from /home/vladan/.rvm/gems/ruby-3.0.3/gems/spree_core-4.4.0/app/models/spree/product.rb:21:in

'
from /home/vladan/.rvm/gems/ruby-3.0.3/gems/bootsnap-1.10.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in require' from /home/vladan/.rvm/gems/ruby-3.0.3/gems/bootsnap-1.10.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in require'
from /home/vladan/.rvm/gems/ruby-3.0.3/gems/polyglot-0.3.5/lib/polyglot.rb:65:in require' from /home/vladan/.rvm/gems/ruby-3.0.3/gems/zeitwerk-2.5.3/lib/zeitwerk/kernel.rb:27:in require'
from /home/vladan/.rvm/gems/ruby-3.0.3/gems/spree_api-4.4.0/lib/spree/api/engine.rb:23:in activate' from /home/vladan/.rvm/gems/ruby-3.0.3/gems/activesupport-6.1.4.4/lib/active_support/callbacks.rb:427:in instance_exec'

@vbujas vbujas changed the title "Wron g number of argumants" error whn running install "Wrong number of argumants" error whn running install Oct 10, 2022
@vbujas
Copy link
Author

vbujas commented Oct 10, 2022

I was able to resolve the issue by following these instructions
norman/friendly_id-globalize@d0b36c8

the same bug was already solved in
#86

@vbujas vbujas closed this as completed Oct 10, 2022
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