'ArgumentError: wrong number of arguments with `bundle exec rake db:migrate`
I'm trying to install Discourse in macOS for development, following the steps mentioned here: https://meta.discourse.org/t/beginners-guide-to-install-discourse-on-macos-for-development/15772
After following the steps mentioned here: https://community.unix.com/t/macos-catalina-discourse-development-environment-notes/378448 to run bundle install
, I tried to use bundle exec rake db:migrate
(as stated in installation instructions), and it showed me this error:
% bundle exec rake db:migrate
rake aborted!
ArgumentError: wrong number of arguments (given 1, expected 0; required keywords: site_setting_name, title, raw)
/Users/jonathanhung/discourse/lib/seed_data/topics.rb:126:in `create_topic'
/Users/jonathanhung/discourse/lib/seed_data/topics.rb:16:in `block (2 levels) in create'
/Users/jonathanhung/discourse/lib/seed_data/topics.rb:15:in `each'
/Users/jonathanhung/discourse/lib/seed_data/topics.rb:15:in `block in create'
/Users/Tim/bin/gems/i18n-1.8.10/lib/i18n.rb:314:in `with_locale'
/Users/jonathanhung/discourse/lib/seed_data/topics.rb:14:in `create'
(eval):14:in `block (2 levels) in run_file'
/Users/Tim/bin/gems/seed-fu-2.3.9/lib/seed-fu/runner.rb:46:in `eval'
/Users/Tim/bin/gems/seed-fu-2.3.9/lib/seed-fu/runner.rb:46:in `block (2 levels) in run_file'
/Users/Tim/bin/gems/seed-fu-2.3.9/lib/seed-fu/runner.rb:58:in `block in open'
/Users/Tim/bin/gems/seed-fu-2.3.9/lib/seed-fu/runner.rb:57:in `open'
/Users/Tim/bin/gems/seed-fu-2.3.9/lib/seed-fu/runner.rb:57:in `open'
/Users/Tim/bin/gems/seed-fu-2.3.9/lib/seed-fu/runner.rb:36:in `block in run_file'
/Users/Tim/bin/gems/activerecord-6.1.3.2/lib/active_record/connection_adapters/abstract/database_statements.rb:320:in `block in transaction'
/Users/Tim/bin/gems/activerecord-6.1.3.2/lib/active_record/connection_adapters/abstract/transaction.rb:310:in `block in within_new_transaction'
/Users/Tim/bin/gems/activesupport-6.1.3.2/lib/active_support/concurrency/load_interlock_aware_monitor.rb:26:in `block (2 levels) in synchronize'
/Users/Tim/bin/gems/activesupport-6.1.3.2/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `handle_interrupt'
/Users/Tim/bin/gems/activesupport-6.1.3.2/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `block in synchronize'
/Users/Tim/bin/gems/activesupport-6.1.3.2/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `handle_interrupt'
/Users/Tim/bin/gems/activesupport-6.1.3.2/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `synchronize'
/Users/Tim/bin/gems/activerecord-6.1.3.2/lib/active_record/connection_adapters/abstract/transaction.rb:308:in `within_new_transaction'
/Users/Tim/bin/gems/activerecord-6.1.3.2/lib/active_record/connection_adapters/abstract/database_statements.rb:320:in `transaction'
/Users/Tim/bin/gems/activerecord-6.1.3.2/lib/active_record/transactions.rb:209:in `transaction'
/Users/Tim/bin/gems/seed-fu-2.3.9/lib/seed-fu/runner.rb:35:in `run_file'
/Users/Tim/bin/gems/seed-fu-2.3.9/lib/seed-fu/runner.rb:26:in `block in run'
/Users/Tim/bin/gems/seed-fu-2.3.9/lib/seed-fu/runner.rb:25:in `each'
/Users/Tim/bin/gems/seed-fu-2.3.9/lib/seed-fu/runner.rb:25:in `run'
/Users/Tim/bin/gems/seed-fu-2.3.9/lib/seed-fu.rb:29:in `seed'
/Users/jonathanhung/discourse/lib/tasks/db.rake:222:in `block in <main>'
/Users/Tim/bin/gems/rake-13.0.3/exe/rake:27:in `<top (required)>'
/Users/jonathanhung/.rbenv/versions/3.0.1/bin/bundle:23:in `load'
/Users/jonathanhung/.rbenv/versions/3.0.1/bin/bundle:23:in `<main>'
Tasks: TOP => db:migrate
(See full trace by running task with --trace)
Does anyone know what I could do to fix it? Thank you for your feedback.
Note: I'm using macOS version 11.4
Solution 1:[1]
Here is the solution: https://meta.discourse.org/t/discourse-installation-fails-on-database-migration/194867/5
Or you can change create_topic(params)
to create_topic(**params)
(update_topic
as well)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Valentin Nechitailenko |