Discourse installation fails on database migration

AI-generated summary

A user, mihco, encountered an error during the database migration process while installing Discourse for development on their PC using WSL2 with Ubuntu. The error occurred in the create_topic function due to incorrect arguments being passed.

mihco followed the “Beginners guide to install Discourse on Windows 10 for Development” guide, but the installation recently started showing the error.

Several users suggested solutions, including shafou, who solved a similar issue by downgrading Ruby from 3.0.0 to 2.7.2. mihco confirmed that downgrading Ruby worked. However, mrj noted that Discourse master is not compatible with Ruby 3 and suggested updating the README to reflect the requirement for “Ruby 2.7+”.

Hello, I’m attempting to install Discourse for development on my PC, however running bundle exec rake db:migrate causes this error to appear:

ArgumentError: wrong number of arguments (given 1, expected 0; required keywords: site_setting_name, title, raw)
/home/mihco/discourse/lib/seed_data/topics.rb:126:in `create_topic'
/home/mihco/discourse/lib/seed_data/topics.rb:16:in `block (2 levels) in create'
/home/mihco/discourse/lib/seed_data/topics.rb:15:in `each'
/home/mihco/discourse/lib/seed_data/topics.rb:15:in `block in create'
/home/mihco/discourse/lib/seed_data/topics.rb:14:in `create'
(eval):14:in `block (2 levels) in run_file'
/home/mihco/discourse/lib/tasks/db.rake:222:in `block in <main>'
/home/mihco/.rbenv/versions/3.0.1/bin/bundle:23:in `load'
/home/mihco/.rbenv/versions/3.0.1/bin/bundle:23:in `<main>'
Tasks: TOP => db:migrate
(See full trace by running task with --trace)

It is an issue with the create_topic function, but I am unable to figure out how to change the parameters being passed as the migration is happening. What can I do about the extra arguments being passed?

Hello Michal :wave:t5:

Which of the dev-install guides did you follow to do this install?

Beginners guide to install Discourse on Windows 10 for Development. I’m using WSL2 with Ubuntu 2 for the installation. The installation went smoothly at first and I was able to run the server successfully when I installed Discourse about 2 weeks ago but now it started to show me that error

I had a similiar problem. Downgrading ruby from 3.0.0 to 2.7.2 solved it for me.

Downgrading worked, thanks!

Yes, Discourse master isn’t yet compatible with Ruby 3. I got past the seeding errors by adding two double-splats to topics.rb, but then get Job exception: wrong number of arguments errors when starting the server.

The README currently asks for “Ruby 2.7+”, so it should be changed.