Beginners Guide to Install Discourse on Windows 10 for Development

You’ve to follow those steps.

You can run sidekiq by the command bundle exec sidekiq. No need to specify the config file.

4 Likes

I’ve updated the guide to clearly mention that the remaining steps have to be carried out, thanks!

4 Likes

Thanks for updating. It makes more sense now. :ok_hand:

Though you are telling to not use rails server only at the very bottom of this page and then before the “go through all the remaining steps of the Ubuntu guide” includes executing that command. I would suggest leaving a note about it because the way you follow logically this guide, you can be sure people will try it and it won’t work as expected. :thinking:


Is there a reason sidekiq is not part of this guide?
Personally, I added this in start-discourse:

cd ~/discourse
bundle exec sidekiq --daemon --logfile "log/sidekiq.log"

Maybe adding also:

bundle exec puma --daemon --redirect-stdout "log/puma.log" --redirect-stderr "log/puma_error.log"

For now, it seems to work.

I have one immediate issue is the images with localhost in the URL are broken due to the missing port, example:


I did not find any port settings. Is something can be done for that?


Another issue is it seems I can’t upgrade in this environment. Is it expected?


image

1 Like

Am I ever having fun!!

Hi, I am trying to get WSL working as I stupidly (so amazingly stupidly) decided to upgrade my development Ubuntu machine from 16.04 to 18.04 and now I can’t configure the display adapter…

…anyway, so I’m trying to install Discourse dev under Windows Subsystem for Linux and I’ve followed the instructions here and in the Ubuntu Dev thread but am running into problems running the rake db:create db:migrate command.

$ bundle exec rake db:create db:migrate
No connection to db, unable to retrieve site settings! (normal when running db:create)
No connection to db, unable to retrieve site settings! (normal when running db:create)
No connection to db, unable to retrieve site settings! (normal when running db:create)
No connection to db, unable to retrieve site settings! (normal when running db:create)
No connection to db, unable to retrieve site settings! (normal when running db:create)
No connection to db, unable to retrieve site settings! (normal when running db:create)
No connection to db, unable to retrieve site settings! (normal when running db:create)
No connection to db, unable to retrieve site settings! (normal when running db:create)
could not connect to server: No such file or directory
        Is the server running locally and accepting
        connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
Couldn't create 'discourse_development' database. Please check your configuration.
rake aborted!
PG::ConnectionBad: could not connect to server: No such file or directory
        Is the server running locally and accepting
        connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?

This looks like the same problem reported in the Ubuntu dev thread.

What have I tried?

I’ve checked that Postgres is running. Which it appears to be:

ps -fe | grep "postg"
postgres    71     1  0 16:58 ?        00:00:01 /usr/lib/postgresql/10/bin/postgres -D /var/lib/postgresql/10/main -c config_file=/etc/postgresql/10/main/postgresql.conf
postgres    73    71  0 16:58 ?        00:00:00 postgres: 10/main: checkpointer process
postgres    74    71  0 16:58 ?        00:00:00 postgres: 10/main: writer process
postgres    75    71  0 16:58 ?        00:00:00 postgres: 10/main: wal writer process
postgres    76    71  0 16:58 ?        00:00:00 postgres: 10/main: autovacuum launcher process
postgres    77    71  0 16:58 ?        00:00:01 postgres: 10/main: stats collector process
postgres    78    71  0 16:58 ?        00:00:00 postgres: 10/main: bgworker: logical replication launcher
$ sudo service postgresql status
10/main (port 5433): online

I’ve checked that my user Postgres user was created and that it is the same name as my Ubuntu username (danny).

sudo -u postgres psql postgres
psql (10.6 (Ubuntu 10.6-0ubuntu0.18.04.1))
Type "help" for help.

postgres=# \du
                                   List of roles
 Role name |                         Attributes                         | Member of
-----------+------------------------------------------------------------+-----------
 danny     | Superuser, Create role, Create DB                          | {}
 postgres  | Superuser, Create role, Create DB, Replication, Bypass RLS | {}

postgres=#

I’ve started Redis, and it seems to be running.

$ redis-cli ping
PONG

Because I’m on a host Windows system which had its own Postgres (on Windows) installation, I’ve stopped the service and then subsequently removed the Windows Postgres installation, but still the same result.

I’ve restarted the Linux subsystem as well as Windows.

I’ve turned off the Windows Firewall but still to no avail.

Here is the rake command with --trace in case it sheds any more light.

bundle exec rake db:create db:migrate --trace
** Invoke db:create (first_time)
** Invoke db:load_config (first_time)
** Invoke environment (first_time)
** Execute environment
No connection to db, unable to retrieve site settings! (normal when running db:create)
No connection to db, unable to retrieve site settings! (normal when running db:create)
No connection to db, unable to retrieve site settings! (normal when running db:create)
No connection to db, unable to retrieve site settings! (normal when running db:create)
No connection to db, unable to retrieve site settings! (normal when running db:create)
No connection to db, unable to retrieve site settings! (normal when running db:create)
No connection to db, unable to retrieve site settings! (normal when running db:create)
No connection to db, unable to retrieve site settings! (normal when running db:create)
** Execute db:load_config
** Execute db:create
could not connect to server: No such file or directory
        Is the server running locally and accepting
        connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
Couldn't create 'discourse_development' database. Please check your configuration.
rake aborted!
PG::ConnectionBad: could not connect to server: No such file or directory
        Is the server running locally and accepting
        connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
/home/danny/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/pg-1.1.3/lib/pg.rb:56:in `initialize'
/home/danny/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/pg-1.1.3/lib/pg.rb:56:in `new'
/home/danny/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/pg-1.1.3/lib/pg.rb:56:in `connect'
/home/danny/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/activerecord-5.2.2/lib/active_record/connection_adapters/postgresql_adapter.rb:692:in `connect'
/home/danny/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/activerecord-5.2.2/lib/active_record/connection_adapters/postgresql_adapter.rb:223:in `initialize'
/home/danny/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/activerecord-5.2.2/lib/active_record/connection_adapters/postgresql_adapter.rb:48:in `new'
/home/danny/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/activerecord-5.2.2/lib/active_record/connection_adapters/postgresql_adapter.rb:48:in `postgresql_connection'
/home/danny/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/activerecord-5.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:811:in `new_connection'
/home/danny/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/activerecord-5.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:855:in `checkout_new_connection'
/home/danny/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/activerecord-5.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:834:in `try_to_checkout_new_connection'
/home/danny/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/activerecord-5.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:795:in `acquire_connection'
/home/danny/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/activerecord-5.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:523:in `checkout'
/home/danny/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/activerecord-5.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:382:in `connection'
/home/danny/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/activerecord-5.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:1010:in `retrieve_connection'
/home/danny/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/activerecord-5.2.2/lib/active_record/connection_handling.rb:118:in `retrieve_connection'
/home/danny/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/activerecord-5.2.2/lib/active_record/connection_handling.rb:90:in `connection'
/home/danny/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/activerecord-5.2.2/lib/active_record/tasks/postgresql_database_tasks.rb:12:in `connection'
/home/danny/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/activerecord-5.2.2/lib/active_record/tasks/postgresql_database_tasks.rb:21:in `create'
/home/danny/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/activerecord-5.2.2/lib/active_record/tasks/database_tasks.rb:119:in `create'
/home/danny/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/activerecord-5.2.2/lib/active_record/tasks/database_tasks.rb:139:in `block in create_current'
/home/danny/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/activerecord-5.2.2/lib/active_record/tasks/database_tasks.rb:316:in `block in each_current_configuration'
/home/danny/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/activerecord-5.2.2/lib/active_record/tasks/database_tasks.rb:313:in `each'
/home/danny/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/activerecord-5.2.2/lib/active_record/tasks/database_tasks.rb:313:in `each_current_configuration'
/home/danny/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/activerecord-5.2.2/lib/active_record/tasks/database_tasks.rb:138:in `create_current'
/home/danny/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/activerecord-5.2.2/lib/active_record/railties/databases.rake:29:in `block (2 levels) in <main>'
/home/danny/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/rake-12.3.2/lib/rake/task.rb:273:in `block in execute'
/home/danny/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/rake-12.3.2/lib/rake/task.rb:273:in `each'
/home/danny/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/rake-12.3.2/lib/rake/task.rb:273:in `execute'
/home/danny/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/rake-12.3.2/lib/rake/task.rb:214:in `block in invoke_with_call_chain'
/home/danny/.rbenv/versions/2.5.3/lib/ruby/2.5.0/monitor.rb:226:in `mon_synchronize'
/home/danny/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/rake-12.3.2/lib/rake/task.rb:194:in `invoke_with_call_chain'
/home/danny/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/rake-12.3.2/lib/rake/task.rb:183:in `invoke'
/home/danny/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/rake-12.3.2/lib/rake/application.rb:160:in `invoke_task'
/home/danny/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/rake-12.3.2/lib/rake/application.rb:116:in `block (2 levels) in top_level'
/home/danny/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/rake-12.3.2/lib/rake/application.rb:116:in `each'
/home/danny/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/rake-12.3.2/lib/rake/application.rb:116:in `block in top_level'
/home/danny/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/rake-12.3.2/lib/rake/application.rb:125:in `run_with_threads'
/home/danny/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/rake-12.3.2/lib/rake/application.rb:110:in `top_level'
/home/danny/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/rake-12.3.2/lib/rake/application.rb:83:in `block in run'
/home/danny/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/rake-12.3.2/lib/rake/application.rb:186:in `standard_exception_handling'
/home/danny/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/rake-12.3.2/lib/rake/application.rb:80:in `run'
/home/danny/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/rake-12.3.2/exe/rake:27:in `<top (required)>'
/home/danny/.rbenv/versions/2.5.3/bin/rake:23:in `load'
/home/danny/.rbenv/versions/2.5.3/bin/rake:23:in `<top (required)>'
/home/danny/.rbenv/versions/2.5.3/lib/ruby/site_ruby/2.5.0/bundler/cli/exec.rb:74:in `load'
/home/danny/.rbenv/versions/2.5.3/lib/ruby/site_ruby/2.5.0/bundler/cli/exec.rb:74:in `kernel_load'
/home/danny/.rbenv/versions/2.5.3/lib/ruby/site_ruby/2.5.0/bundler/cli/exec.rb:28:in `run'
/home/danny/.rbenv/versions/2.5.3/lib/ruby/site_ruby/2.5.0/bundler/cli.rb:463:in `exec'
/home/danny/.rbenv/versions/2.5.3/lib/ruby/site_ruby/2.5.0/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/home/danny/.rbenv/versions/2.5.3/lib/ruby/site_ruby/2.5.0/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
/home/danny/.rbenv/versions/2.5.3/lib/ruby/site_ruby/2.5.0/bundler/vendor/thor/lib/thor.rb:387:in `dispatch'
/home/danny/.rbenv/versions/2.5.3/lib/ruby/site_ruby/2.5.0/bundler/cli.rb:27:in `dispatch'
/home/danny/.rbenv/versions/2.5.3/lib/ruby/site_ruby/2.5.0/bundler/vendor/thor/lib/thor/base.rb:466:in `start'
/home/danny/.rbenv/versions/2.5.3/lib/ruby/site_ruby/2.5.0/bundler/cli.rb:18:in `start'
/home/danny/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/bundler-1.17.3/exe/bundle:30:in `block in <top (required)>'
/home/danny/.rbenv/versions/2.5.3/lib/ruby/site_ruby/2.5.0/bundler/friendly_errors.rb:124:in `with_friendly_errors'
/home/danny/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/bundler-1.17.3/exe/bundle:22:in `<top (required)>'
/home/danny/.rbenv/versions/2.5.3/bin/bundle:23:in `load'
/home/danny/.rbenv/versions/2.5.3/bin/bundle:23:in `<main>'
Tasks: TOP => db:create

Any ideas?

EDIT: my two posts are minutes apart because I forgot to press Reply to the first one. I’ve since done some more digging.

EDIT2: So here is what I think is going on.

There seems to be a problem with ident identification on WSL. i.e. the operating system username, on its own, doesn’t seem to allow clients to connect to Postgres.

So two problems here - one Postgres installed on the wrong port and user identification seems not to work on WSL.

Port problem

The Postgres server is running on 5433 and rake is expecting it on 5432.

I installed Postgres (using the Discourse dev setup script) into the Windows Subsystem for Linux but I already had a Postgres server running on port 5432 in the native Windows system.

I assume that as a result the WSL Postgres server got bumped to 5433. So, after uninstalling the Postgres windows server, I changed the postgresql.conf file to start on port 5432. This then allowed me to connect to Postgres - by using su - postgres.

Validation of User

By trying to connect to the server, now running on the correct port, using psql it would ask me for a password for the user with my username danny.

Now I created the danny Postrges user, using @techAPJ’s instructions here…

I obviously changed techapj to danny but at no time in the creation process was I asked for a password.

My assumption here is that the Postgres createuser command creates a Postgres user linked to a local user and that it relies on the operating system to identify and validate the user - hence no password?

So why was I being asked for a password when I was logged in as the user danny?

When I looked in the 'pg_hba.conf` (which controls how users gain access for different types of connection - local, tcp, etc.) file…

# DO NOT DISABLE!
# If you change this first entry you will need to make sure that the
# database superuser can access the database using some other method.
# Noninteractive access to all databases is required during automatic
# maintenance (custom daily cronjobs, replication, and similar tasks).
#
# Database administrative login by Unix domain socket
local   all             postgres                                peer

# TYPE  DATABASE        USER            ADDRESS                 METHOD

# "local" is for Unix domain socket connections only
local   all             all                                     peer
# IPv4 local connections:
host    all             all             127.0.0.1/32            ident
# IPv6 local connections:
host    all             all             ::1/128                 ident
# Allow replication connections from localhost, by a user with the
# replication privilege.
local   replication     all                                     peer
host    replication     all             127.0.0.1/32            md5
host    replication     all             ::1/128                 md5

…the method of connection for the danny user was set to ident - i.e let the operating system handle identification. But again, I was logged in as danny and was still challenged for my password. So I don’t know why that wasn’t working.

To test if this was causing the problem, and because this is my dev system with no crucial data, I changed the ident setting to trust which it seems allows a connection with no challenge at all.

Et voila, I was connected and it worked - the rake command executed and I’ve started the server and got the party time splash screen.

I note that the instructions for creating the database user on the Beginners Guide to Install Discourse on Ubuntu for Development thread changed in the not so distant past.

The instructions used to be (revision 45).

Setup Database

Open psql prompt as postgres user

sudo -u postgres psql postgres

Create role with the same name as your ubuntu system username with discourse as password:

CREATE ROLE techapj WITH LOGIN ENCRYPTED PASSWORD 'discourse' CREATEDB SUPERUSER;

I wonder if these instruction might still need to be followed for WSL? i.e. explicitly specify a password.

IF I get time I will try a reinstallation and test at each stage because the trust solution does feel like a solution, TBH.

Should we be mounting into Windows from the Linux Subsystem (eg: $ cd /mnt/c) if we plan to use our Windows code editor to develop?

In the Beginners Guide to Install Discourse on Ubuntu for Development, we clone the Discourse repo into ~/discourse, which is actually physically saving it onto your harddrive under: C:\Users\{USER}\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc

However, I’ve been reading that we shouldn’t actually edit any files in this path using Windows tools because it can corrupt the Linux environment (https://askubuntu.com/a/759885). So should we actually be cloning into /mnt/c/... and doing everything from there or does it not matter? Basically I just want to develop a simple component and it would be easier to do with my current setup

Edit: Never mind, I’m using the Discourse Theme CLI now!

If anyone runs into this error while trying to start pg on WSL:

PANIC: could not flush dirty data: Function not implemented

The solution is to set fsync = off in /etc/postgresql.conf (see here)
Just note that this puts you at risk of data corruption on system crash. (see here)

Looks like PG are going to workaround this WSL limitation shortly.

https://www.postgresql.org/message-id/flat/CA%2BmCpegfOUph2U4ZADtQT16dfbkjjYNJL1bSTWErsazaFjQW9A%40mail.gmail.com

3 Likes

Hello,
While installing discourse in windows 10, I am stuck at below step.

bundle exec rake db:create db:migrate

I have tried disabling linux sub system and reinstalling everything as this guide. Still I run into below problem.

ActiveRecord::StatementInvalid: PG::UndefinedTable: ERROR: relation "polls" does not exist

~ Thanks

1 Like

Are you setting the RAILS_ENV variable? I just had this same issue and that fixed it

bundle exec rake db:create 
bundle exec rake db:migrate
RAILS_ENV=test bundle exec rake db:create db:migrate

Hello,

The installation process worked fine and the server seems to run ok:

bundle exec puma -p 3000
Puma starting in single mode...
* Version 4.3.1 (ruby 2.6.2-p47), codename: Mysterious Traveller
* Min threads: 0, max threads: 16
* Environment: development
Starting CSS change watcher
* Listening on tcp://0.0.0.0:3000
Use Ctrl-C to stop

But in the browser, I get 14 of those Content Security Policy errors (and the page remains blank):

Uncaught EvalError: Refused to evaluate a string as JavaScript because 
'unsafe-eval' is not an allowed source of script in the following Content 
Security Policy directive: "script-src 'report-sample' localhost:3000/logs/ localhost:3000/sidekiq/ localhost:3000/mini-profiler-resources/ localhost:3000/assets/ localhost:3000/brotli_asset/ localhost:3000/extra-locales/ localhost:3000/highlight-js/ localhost:3000/javascripts/ localhost:3000/plugins/ localhost:3000/theme-javascripts/ localhost:3000/svg-sprite/".

I’ve reinstalled my Ubuntu from scratch, tried changing the port, disabling the firewall, etc., but I cannot figure it out. Any idea?

1 Like

I found the reason:

1 Like

I did exactly this. The way the guide is written I expected to have a working server after Step 2 and that everything beyond was optional scripts for convenience. I think the part about running puma instead needs to be much more prominent in the guide.

Thanks @ramjke, but I’m not sure this is linked to my issue: I was not trying to install a plugin, just to install Discourse (and it seems Discourse doesn’t have any eval in its code).

Anyway, after five installs, I finally got it to work. I don’t know what I did to fix the issue. Each time, I got multiple errors in bundle exec rake autospec. The last time, one of those errors said to execute RAILS_ENV=test bin/rake db:migrate, which I did. After that, I still got errors in bundle exec rake autospec, but I ignored them and the instance works anyway.

One more things that could be useful to others: I’m using Ubuntu 18.04 LTS. I’ve tried with Ubuntu 16.04 LTS but got even more problems.

~ Edited version ~

In my test environment, puma suffers from random crashes when source files are edited from Windows (although managing Linux files from Windows is now advertised to be working fine).

  • When using copy or robocopy of .js files from Windows to WSL, puma randomely hangs (maybe a bit less often when using puma “cluster mode”, but I’m not sure anymore).

  • When using a Linux simlink from WSL to Windows and editing a .css file in Windows, the stylesheet is not updated and puma displays the following error: CSS change notifier crashed No such file or directory @ rb_sysopen - /home/jack/discourse/app/assets/stylesheets/image.scss
    (and creating the missing file causes another exception)

~ Original post ~

Here is another issue:

In my test environment, puma “single mode” doesn’t work well under WSL. It sometimes goes into deadlock when a source file is changed, which is a deal-breaker for plugin development.

The solution is to use puma “cluster mode” instead of “single mode”.

If this is confirmed, the manual should be changed from:

To launch web server use bundle exec puma instead of rails server .

to:

To launch web server use bundle exec puma --worker 1 instead of rails server .

2 Likes

Is this really working? I saw this comment from @sam in Github:

https://github.com/microsoft/WSL/issues/1982#issuecomment-412730481

And I am getting exactly the same error:

Creating scope :open. Overwriting existing method Poll.open.
E, [2020-01-02T02:20:45.659736 #24315] ERROR -- : 127.0.0.1:3000{:tcp_defer_accept=>1, :accept_filter=>"httpready", :backlog=>1024, :tcp_nopush=>nil, :tcp_nodelay=>true}: Protocol not available - setsockopt(2) (Errno::ENOPROTOOPT)
E, [2020-01-02T02:20:45.660642 #24315] ERROR -- : /home/diego/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/unicorn-5.5.2/lib/unicorn/socket_helper.rb:74:in `setsockopt'
E, [2020-01-02T02:20:45.661037 #24315] ERROR -- : /home/diego/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/unicorn-5.5.2/lib/unicorn/socket_helper.rb:74:in `set_tcp_sockopt'
...

WSL1 is a train wreck for any serious dev work, avoid at all costs.

Recommend you join the slow ring and start using WSL2 for Discourse. In that case unicorn works and everything works.

4 Likes

Kk, got it

BTW, I read the post above mine, and I was able to run the server using bundle exec puma --worker 1
Maybe you could consider editing the original topic?

1 Like

It works, sort of, but performance is abysmal.

We will edit the OP here.

2 Likes

If I’m using an up to date Windows machine, what’s the best way to get Discourse running locally for development? Best I can tell, my options are:

  • Linux subsystem on Windows
  • Docker container
  • Traditional Linux VM

I’m leaning towards the Docker container option, but I wanted to make sure one of the options wasn’t vastly superior first.

1 Like