# Install Discourse on macOS for development

**URL:** https://meta.discourse.org/t/install-discourse-on-macos-for-development/15772
**Category:** Developer Guides
**Tags:** dev-install, how-to
**Created:** [May 19, 2014, 4:59pm UTC](https://meta.discourse.org/t/install-discourse-on-macos-for-development/15772 "2014-05-19T16:59:50Z")
**Posts on this page:** 20
**Page:** 5

<div class="post-metadata">

### Author: ![Sisir\_Koppaka](https://avatars.discourse-cdn.com/v4/letter/s/a4c791/32.png) [@Sisir\_Koppaka](https://meta.discourse.org/u/Sisir_Koppaka)
#### Post date: [February 3, 2024, 7:17am UTC](https://meta.discourse.org/t/install-discourse-on-macos-for-development/15772/378 "2024-02-03T07:17:20Z")

</div>

I’m having some issues with setting up discourse for development on my M1 Mac.

fast\_xs and gc\_tracer gems fail to install with almost similar errors. I’ve pasted the fast\_xs error message below. Could someone help ?

````plaintext
Building native extensions. This could take a while...
ERROR: Error installing fast_xs:
	ERROR: Failed to build gem native extension.

    current directory: /Users/sisirkoppaka/.gem/ruby/3.2.0/gems/fast_xs-0.8.0/ext/fast_xs
/Users/sisirkoppaka/.rubies/ruby-3.2.0/bin/ruby -I /Users/sisirkoppaka/.rubies/ruby-3.2.0/lib/ruby/site_ruby/3.2.0 extconf.rb
checking for assert.h... yes
creating Makefile

current directory: /Users/sisirkoppaka/.gem/ruby/3.2.0/gems/fast_xs-0.8.0/ext/fast_xs
make DESTDIR\= sitearchdir\=./.gem.20240203-10621-j9d0j7 sitelibdir\=./.gem.20240203-10621-j9d0j7 clean

current directory: /Users/sisirkoppaka/.gem/ruby/3.2.0/gems/fast_xs-0.8.0/ext/fast_xs
make DESTDIR\= sitearchdir\=./.gem.20240203-10621-j9d0j7 sitelibdir\=./.gem.20240203-10621-j9d0j7
compiling fast_xs.c
fast_xs.c:144:39: error: incompatible function pointer types passing 'VALUE (VALUE)' (aka 'unsigned long (unsigned long)') to parameter of type 'VALUE (*)(VALUE, VALUE)' (aka 'unsigned long (*)(unsigned long, unsigned long)') [-Wincompatible-function-pointer-types]
  144 | array = rb_rescue(unpack_utf8, self, unpack_uchar, self);
      | ^ ~~~~~~~~~~~
/Users/sisirkoppaka/.rubies/ruby-3.2.0/include/ruby-3.2.0/ruby/internal/iterator.h:364:62: note: passing argument to parameter 'r_proc' here
  364 | VALUE rb_rescue(VALUE (*b_proc)(VALUE), VALUE data1, VALUE (*r_proc)(VALUE, VALUE), VALUE data2);
      | ^
1 error generated.
make: *** [fast_xs.o] Error 1

make failed, exit code 2

Gem files will remain installed in /Users/sisirkoppaka/.gem/ruby/3.2.0/gems/fast_xs-0.8.0 for inspection.
Results logged to /Users/sisirkoppaka/.gem/ruby/3.2.0/extensions/arm64-darwin-22/3.2.0-static/fast_xs-0.8.0/gem_make.out```
````

---

<div class="post-metadata">

### Author: ![Gokul](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gokul/32/366628_2.png) [@Gokul](https://meta.discourse.org/u/Gokul)
#### Post date: [February 29, 2024, 7:33am UTC](https://meta.discourse.org/t/install-discourse-on-macos-for-development/15772/379 "2024-02-29T07:33:46Z")

</div>

How was this resolved?

---

<div class="post-metadata">

### Author: ![Gokul](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gokul/32/366628_2.png) [@Gokul](https://meta.discourse.org/u/Gokul)
#### Post date: [February 29, 2024, 8:06am UTC](https://meta.discourse.org/t/install-discourse-on-macos-for-development/15772/380 "2024-02-29T08:06:23Z")

</div>

When executing

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

```

after starting both Redis and Postgres servers I get the following error.

```plaintext
fe_sendauth: no password supplied
Couldn't create 'discourse_development' database. Please check your configuration.
rake aborted!

```

When I do this without starting my Redis and Postgres servers I get the following error.

```plaintext
bundle exec rake db:migrate
RAILS_ENV=test bundle exec rake db:create db:migrate
Couldn't connect to Redis
rake aborted!

```

Can someone tell me what to do, I am lost.

Thanks

---

<div class="post-metadata">

### Author: ![BusiRocket](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/busirocket/32/371446_2.png) [@BusiRocket](https://meta.discourse.org/u/BusiRocket)
#### Post date: [March 15, 2024, 7:25pm UTC](https://meta.discourse.org/t/install-discourse-on-macos-for-development/15772/381 "2024-03-15T19:25:30Z")

</div>

So far I have managed to solve it with the following commands:

```bash
bundle config build.fast_xs --with-cflags=\"-Wno-incompatible-pointer-types\"
bundle config build.gc_tracer --with-cflags=\"-Wno-incompatible-pointer-types\"
bundle install

```

---

<div class="post-metadata">

### Author: ![tgxworld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tgxworld/32/106117_2.png) [@tgxworld](https://meta.discourse.org/u/tgxworld)
#### Post date: [March 31, 2024, 11:17pm UTC](https://meta.discourse.org/t/install-discourse-on-macos-for-development/15772/382 "2024-03-31T23:17:55Z")

</div>

Note that we have decided to drop both of these non-essential gems in

[https://github.com/discourse/discourse/pull/26441](https://github.com/discourse/discourse/pull/26441)

and

[https://github.com/discourse/discourse/pull/26442](https://github.com/discourse/discourse/pull/26442)

---

<div class="post-metadata">

### Author: ![rebelquack](https://avatars.discourse-cdn.com/v4/letter/r/eb8c5e/32.png) [@rebelquack](https://meta.discourse.org/u/rebelquack)
#### Post date: [June 18, 2024, 8:03am UTC](https://meta.discourse.org/t/install-discourse-on-macos-for-development/15772/384 "2024-06-18T08:03:02Z")

</div>

> [@Discourse](#):
>
> **Option 2** : using only one Terminal tab/window:
> 
> ```plaintext
> bin/ember-cli -u # will run the Unicorn server in the background
> 
> ```

After invoking this option, how does one then shut down the server?

---

<div class="post-metadata">

### Author: ![Pieces](https://avatars.discourse-cdn.com/v4/letter/p/958977/32.png) [@Pieces](https://meta.discourse.org/u/Pieces)
#### Post date: [September 18, 2024, 11:13pm UTC](https://meta.discourse.org/t/install-discourse-on-macos-for-development/15772/385 "2024-09-18T23:13:49Z")

</div>

This doesn’t seem to work (anymore), I am getting:

```plaintext
fatal: couldn't find remote ref master

```

Neither does the version to overwrite local changes (2 posts down).

Any ideas on how to upgrade a macOS Discourse Dev Install?

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [September 18, 2024, 11:56pm UTC](https://meta.discourse.org/t/install-discourse-on-macos-for-development/15772/386 "2024-09-18T23:56:40Z")

</div>

`master` was renamed to `main` a while ago. Try

```plaintext
cd ~/discourse
git pull origin main

```

---

<div class="post-metadata">

### Author: ![Pieces](https://avatars.discourse-cdn.com/v4/letter/p/958977/32.png) [@Pieces](https://meta.discourse.org/u/Pieces)
#### Post date: [September 19, 2024, 12:23pm UTC](https://meta.discourse.org/t/install-discourse-on-macos-for-development/15772/387 "2024-09-19T12:23:32Z")

</div>

Thanks Simon, that helps.

I was able to run the git command but somewhere along the way broke my development environment. I now ended up with a broken dev environment, it shows my Discourse dev homepage but nothing seems to work (New Topic keeps spinning).

What is the easiest way to do a reset or a clean install of my Discourse dev install?

I tried to rerun the install commands at the start of this topic (it breaks on the `pnpm install` command). I also tried to run `rake db:drop db:create db:migrate` proposed by Arpit earlier in this topic, no success either.

---

<div class="post-metadata">

### Author: ![Pieces](https://avatars.discourse-cdn.com/v4/letter/p/958977/32.png) [@Pieces](https://meta.discourse.org/u/Pieces)
#### Post date: [September 19, 2024, 12:48pm UTC](https://meta.discourse.org/t/install-discourse-on-macos-for-development/15772/388 "2024-09-19T12:48:15Z")

</div>

I was able to update my pnpm and node installs by running `npm install -g pnpm` and `brew install node` which allowed me to rerun the install instructions again. However I am now getting the following Build error:

```plaintext
Module not found: Error: Can't resolve '@ember/debug' in '/Users/pieces/discourse/app/assets/javascripts/node_modules/ember-tracked-storage-polyfill/addon/index.js'

```

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [September 19, 2024, 7:47pm UTC](https://meta.discourse.org/t/install-discourse-on-macos-for-development/15772/389 "2024-09-19T19:47:58Z")

</div>

> [@Pieces](#):
>
> I was able to update my pnpm and node installs by running `npm install -g pnpm`

Did you run `pnpm install` after running `npm install -g pnpm`?

Details about the change to using `pnpm` for package management are here: [Discourse core is switching to pnpm for JS package management](https://meta.discourse.org/t/discourse-core-is-switching-to-pnpm-for-js-package-management/324521#p-1594753-development-2).

---

<div class="post-metadata">

### Author: ![Pieces](https://avatars.discourse-cdn.com/v4/letter/p/958977/32.png) [@Pieces](https://meta.discourse.org/u/Pieces)
#### Post date: [September 19, 2024, 9:00pm UTC](https://meta.discourse.org/t/install-discourse-on-macos-for-development/15772/390 "2024-09-19T21:00:20Z")

</div>

Yes I did, still getting the error.

I performed the following steps:

1. I updated packages on my Mac (reran the initial script)
2. Ran `bundle install`
3. Ran `pnpm install`
4. Ran `bundle exec rake db:create bundle exec rake db:migrate RAILS_ENV=test bundle exec rake db:create db:migrate`
5. Ran `bundle exec rails server`
6. Ran `bin/ember-cli` in a separate terminal window

Running step 6 throws the error.

Looking at the details from the link you provided it feels like the Yarn Managed Node modules are not properly converted to pnpm? It talks about manually removing the ‘node\_modules’ folder. However, this should be taken care of with the new git pull, right?

Please see below the error from step 6.

 ![The image displays a computer screen with a command-line interface in a terminal window. (Captioned by AI)](https://global.discourse-cdn.com/meta/original/4X/f/5/3/f53dc6d95c6ab2c0c72517ba067adce8bf2871d3.png)

I can share the mentioned error log if that will help find the cause.

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [September 19, 2024, 10:12pm UTC](https://meta.discourse.org/t/install-discourse-on-macos-for-development/15772/391 "2024-09-19T22:12:40Z")

</div>

It’s worth noting that I don’t have a macOS system to test this on. I recently updated my local instance of Discourse on an Arch Linux system though. I’d expect the way that javascript dependencies are handled to be similar on both systems.

> [@Pieces](#):
>
> It talks about manually removing the ‘node\_modules’ folder. However, this should be taken care of with the new git pull, right?

I don’t think that is correct. The `node_modules` directory isn’t tracked by git. The node modules are installed when you run `pnpm install`.

I can’t guarantee this is correct, but if I was getting the error, I would remove and then reinstall the dependencies with:

```plaintext
rm -rf node_modules app/assets/javascripts/*/node_modules

pnpm install

```

I think `ember-tracked-storage-polyfill` is in the `discourse/node_modules` directly, but it should be safe to run the full command I posted above.

You could also try runing `pnpm install` with verbose logging if it returns errors:

`pnpm install --reporter=silent --loglevel=verbose`

---

<div class="post-metadata">

### Author: ![Pieces](https://avatars.discourse-cdn.com/v4/letter/p/958977/32.png) [@Pieces](https://meta.discourse.org/u/Pieces)
#### Post date: [September 19, 2024, 11:19pm UTC](https://meta.discourse.org/t/install-discourse-on-macos-for-development/15772/392 "2024-09-19T23:19:28Z")

</div>

I just removed and reinstalled the dependencies, the command provided worked fine. It removes and installs pnpm without errors.

However, when I run the `bin/ember-cli` it still gives the same error.

Is there a way to completely remove my Discourse dev install and do a clean pull from Git and run the install clean?

I am totally fine with losing the data from my dev environment.

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [September 20, 2024, 1:46am UTC](https://meta.discourse.org/t/install-discourse-on-macos-for-development/15772/393 "2024-09-20T01:46:45Z")

</div>

> [@Pieces](#):
>
> Is there a way to completely remove my Discourse dev install and do a clean pull from Git and run the install clean?

You could run `rm -rf ~/discourse` to completely remove the Discourse source code. Then follow the install guide from its “Clone Discourse” step: [Install Discourse on macOS for development](https://meta.discourse.org/t/install-discourse-on-macos-for-development/15772#p-53437-clone-discourse-3).

---

<div class="post-metadata">

### Author: ![Pieces](https://avatars.discourse-cdn.com/v4/letter/p/958977/32.png) [@Pieces](https://meta.discourse.org/u/Pieces)
#### Post date: [September 20, 2024, 8:18pm UTC](https://meta.discourse.org/t/install-discourse-on-macos-for-development/15772/394 "2024-09-20T20:18:08Z")

</div>

That did it!

Thanks for your patience Simon, appreciate you not giving up 🙂

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [September 20, 2024, 8:28pm UTC](https://meta.discourse.org/t/install-discourse-on-macos-for-development/15772/395 "2024-09-20T20:28:11Z")

</div>

Great! I’m guessing that the issue was related to cached assets that had previously been complied in the `/discourse/tmp/cache/assets/sprockets/` directory. Possibly the issue could have been resolved by running:

`rm -rf ~/discourse/tmp/cache/`

This is just a guess though.

---

<div class="post-metadata">

### Author: ![itd-john](https://avatars.discourse-cdn.com/v4/letter/i/8dc957/32.png) [@itd-john](https://meta.discourse.org/u/itd-john)
#### Post date: [July 21, 2025, 5:28pm UTC](https://meta.discourse.org/t/install-discourse-on-macos-for-development/15772/396 "2025-07-21T17:28:43Z")

</div>

I’m not having much luck following these instructions. They are not providing a working environment as I get a 500 error when I try to install anything (plugin, theme, theme-component). It seems like the wizard is not working properly. I’ve installed about 10 times now and uninstalled and reinstalled the dependencies. When I run the autospec, I get many failures but, not much information about them. Any ideas welcome as to how I can get this thing up and running, functionally.

Thanks!

---

<div class="post-metadata">

### Author: ![nick.schneble](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nick.schneble/32/516599_2.png) [@nick.schneble](https://meta.discourse.org/u/nick.schneble)
#### Post date: [September 8, 2025, 6:22pm UTC](https://meta.discourse.org/t/install-discourse-on-macos-for-development/15772/397 "2025-09-08T18:22:41Z")

</div>

For anyone who started from the [Discourse Development README](https://github.com/discourse/discourse?tab=readme-ov-file#development) and came here – if you’re setting up your dependencies for the first time, I’d recommend PostgreSQL 14+, even though it says PostgreSQL 13 in the README.

Why? When you set up your database and run the migrations, it’ll fail when it tries to access the pgvector extension in one of the migrations. And installing pgvector for PostgreSQL 13 is a bit of a pain. But if you install PostgreSQL 14 and then pgvector, it’ll all just work.

I’d recommend Homebrew for both:

```bash
brew install postgresql@14
brew install pgvector

```

Also! You’ll get an error the first time you run the Rails server if you don’t have [ImageMagick](https://imagemagick.org/) installed. (I know it says it’s optional at the top of this guide)

Hope this helps… someone!

---

<div class="post-metadata">

### Author: ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)
#### Post date: [September 8, 2025, 7:04pm UTC](https://meta.discourse.org/t/install-discourse-on-macos-for-development/15772/398 "2025-09-08T19:04:58Z")

</div>

> [@nick.schneble](#):
>
> `brew install postgresql@14`

Production is already 15, I’d recommend that or 16.

[Previous page](https://meta.discourse.org/t/install-discourse-on-macos-for-development/15772.md?page=4)

[Next page](https://meta.discourse.org/t/install-discourse-on-macos-for-development/15772.md?page=6)
