Install Discourse on macOS for development

I agree with your point that this should keep running, but thats not the case here! This command gets executed and then exits!
Also, can you pls elaborate a bit more on how can i fix the image Magick issue here. Not able to understand!

Would i have to install image Margick separately, from here?

3 Likes


On M1 MacBook Pro, i want to running discourse, but when i type

,i can’t access port:4200

1 Like

Back in November, I ran into the same issue on my M1 iMac and managed to solve it thanks to a brilliant member here.

2 Likes

Hi, I had the exact same issues you did in your post, and I’ve tried
gem update --system

and re-attempting and I still get

An error occurred while installing openssl (2.2.1), and Bundler cannot
continue.

In Gemfile:
  cose was resolved to 1.2.0, which depends on
    openssl-signature_algorithm was resolved to 1.1.1, which depends on
      openssl

Any other ideas? maybe I’ll try gem update --system one more time?

1 Like

I’ve been able to update openssl, but how to get Bundler to use the updated openssl and not the old 1.1.1?

1 Like

Hi, I’m trying to setup Discourse on MacOS Catalina (Version 10.15.7) but am encountering an error about no password supplied when I try to run the bundle exec rake db:create.

I had a pre-existing postgres database instance running on my machine prior to my attempted installation of Discourse, I think that could be a factor. How should I resolve this?

Here’s the error stacktrace:

connection to server on socket "/tmp/.s.PGSQL.5432" failed: fe_sendauth: no password supplied
Couldn't create 'discourse_development' database. Please check your configuration.
rake aborted!
ActiveRecord::ConnectionNotEstablished: connection to server on socket "/tmp/.s.PGSQL.5432" failed: fe_sendauth: no password supplied
/Users/alexfowler/discourse/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.4.7/lib/active_record/connection_adapters/postgresql_adapter.rb:83:in `rescue in new_client'
/Users/alexfowler/discourse/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.4.7/lib/active_record/connection_adapters/postgresql_adapter.rb:77:in `new_client'
/Users/alexfowler/discourse/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.4.7/lib/active_record/connection_adapters/postgresql_adapter.rb:37:in `postgresql_connection'
/Users/alexfowler/discourse/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.4.7/lib/active_record/connection_adapters/abstract/connection_pool.rb:882:in `public_send'
/Users/alexfowler/discourse/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.4.7/lib/active_record/connection_adapters/abstract/connection_pool.rb:882:in `new_connection'
/Users/alexfowler/discourse/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.4.7/lib/active_record/connection_adapters/abstract/connection_pool.rb:926:in `checkout_new_connection'
/Users/alexfowler/discourse/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.4.7/lib/active_record/connection_adapters/abstract/connection_pool.rb:905:in `try_to_checkout_new_connection'
/Users/alexfowler/discourse/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.4.7/lib/active_record/connection_adapters/abstract/connection_pool.rb:866:in `acquire_connection'
/Users/alexfowler/discourse/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.4.7/lib/active_record/connection_adapters/abstract/connection_pool.rb:588:in `checkout'
/Users/alexfowler/discourse/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.4.7/lib/active_record/connection_adapters/abstract/connection_pool.rb:428:in `connection'
/Users/alexfowler/discourse/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.4.7/lib/active_record/connection_adapters/abstract/connection_pool.rb:1128:in `retrieve_connection'
/Users/alexfowler/discourse/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.4.7/lib/active_record/connection_handling.rb:327:in `retrieve_connection'
/Users/alexfowler/discourse/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.4.7/lib/active_record/connection_handling.rb:283:in `connection'
/Users/alexfowler/discourse/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.4.7/lib/active_record/tasks/postgresql_database_tasks.rb:12:in `connection'
/Users/alexfowler/discourse/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.4.7/lib/active_record/tasks/postgresql_database_tasks.rb:26:in `create'
/Users/alexfowler/discourse/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.4.7/lib/active_record/tasks/database_tasks.rb:133:in `create'
/Users/alexfowler/discourse/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.4.7/lib/active_record/tasks/database_tasks.rb:193:in `block in create_current'
/Users/alexfowler/discourse/vendor/bundle/ruby/2.7.0/gems/discourse_dev_assets-0.0.3/lib/discourse_dev_assets.rb:27:in `block in each_current_configuration'
/Users/alexfowler/discourse/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.4.7/lib/active_record/tasks/database_tasks.rb:506:in `block (2 levels) in each_current_configuration'
/Users/alexfowler/discourse/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.4.7/lib/active_record/tasks/database_tasks.rb:503:in `each'
/Users/alexfowler/discourse/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.4.7/lib/active_record/tasks/database_tasks.rb:503:in `block in each_current_configuration'
/Users/alexfowler/discourse/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.4.7/lib/active_record/tasks/database_tasks.rb:502:in `each'
/Users/alexfowler/discourse/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.4.7/lib/active_record/tasks/database_tasks.rb:502:in `each_current_configuration'
/Users/alexfowler/discourse/vendor/bundle/ruby/2.7.0/gems/discourse_dev_assets-0.0.3/lib/discourse_dev_assets.rb:22:in `each_current_configuration'
/Users/alexfowler/discourse/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.4.7/lib/active_record/tasks/database_tasks.rb:193:in `create_current'
/Users/alexfowler/discourse/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.4.7/lib/active_record/railties/databases.rake:45:in `block (2 levels) in <main>'
/Users/alexfowler/discourse/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/exe/rake:27:in `<top (required)>'
/Users/alexfowler/.rbenv/versions/2.7.6/bin/bundle:23:in `load'
/Users/alexfowler/.rbenv/versions/2.7.6/bin/bundle:23:in `<main>'

Caused by:
PG::ConnectionBad: connection to server on socket "/tmp/.s.PGSQL.5432" failed: fe_sendauth: no password supplied
/Users/alexfowler/discourse/vendor/bundle/ruby/2.7.0/gems/pg-1.3.5/lib/pg/connection.rb:637:in `async_connect_or_reset'
/Users/alexfowler/discourse/vendor/bundle/ruby/2.7.0/gems/pg-1.3.5/lib/pg/connection.rb:707:in `new'
/Users/alexfowler/discourse/vendor/bundle/ruby/2.7.0/gems/pg-1.3.5/lib/pg.rb:69:in `connect'
/Users/alexfowler/discourse/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.4.7/lib/active_record/connection_adapters/postgresql_adapter.rb:78:in `new_client'
/Users/alexfowler/discourse/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.4.7/lib/active_record/connection_adapters/postgresql_adapter.rb:37:in `postgresql_connection'
/Users/alexfowler/discourse/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.4.7/lib/active_record/connection_adapters/abstract/connection_pool.rb:882:in `public_send'
/Users/alexfowler/discourse/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.4.7/lib/active_record/connection_adapters/abstract/connection_pool.rb:882:in `new_connection'
/Users/alexfowler/discourse/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.4.7/lib/active_record/connection_adapters/abstract/connection_pool.rb:926:in `checkout_new_connection'
/Users/alexfowler/discourse/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.4.7/lib/active_record/connection_adapters/abstract/connection_pool.rb:905:in `try_to_checkout_new_connection'
/Users/alexfowler/discourse/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.4.7/lib/active_record/connection_adapters/abstract/connection_pool.rb:866:in `acquire_connection'
/Users/alexfowler/discourse/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.4.7/lib/active_record/connection_adapters/abstract/connection_pool.rb:588:in `checkout'
/Users/alexfowler/discourse/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.4.7/lib/active_record/connection_adapters/abstract/connection_pool.rb:428:in `connection'
/Users/alexfowler/discourse/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.4.7/lib/active_record/connection_adapters/abstract/connection_pool.rb:1128:in `retrieve_connection'
/Users/alexfowler/discourse/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.4.7/lib/active_record/connection_handling.rb:327:in `retrieve_connection'
/Users/alexfowler/discourse/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.4.7/lib/active_record/connection_handling.rb:283:in `connection'
/Users/alexfowler/discourse/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.4.7/lib/active_record/tasks/postgresql_database_tasks.rb:12:in `connection'
/Users/alexfowler/discourse/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.4.7/lib/active_record/tasks/postgresql_database_tasks.rb:26:in `create'
/Users/alexfowler/discourse/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.4.7/lib/active_record/tasks/database_tasks.rb:133:in `create'
/Users/alexfowler/discourse/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.4.7/lib/active_record/tasks/database_tasks.rb:193:in `block in create_current'
/Users/alexfowler/discourse/vendor/bundle/ruby/2.7.0/gems/discourse_dev_assets-0.0.3/lib/discourse_dev_assets.rb:27:in `block in each_current_configuration'
/Users/alexfowler/discourse/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.4.7/lib/active_record/tasks/database_tasks.rb:506:in `block (2 levels) in each_current_configuration'
/Users/alexfowler/discourse/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.4.7/lib/active_record/tasks/database_tasks.rb:503:in `each'
/Users/alexfowler/discourse/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.4.7/lib/active_record/tasks/database_tasks.rb:503:in `block in each_current_configuration'
/Users/alexfowler/discourse/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.4.7/lib/active_record/tasks/database_tasks.rb:502:in `each'
/Users/alexfowler/discourse/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.4.7/lib/active_record/tasks/database_tasks.rb:502:in `each_current_configuration'
/Users/alexfowler/discourse/vendor/bundle/ruby/2.7.0/gems/discourse_dev_assets-0.0.3/lib/discourse_dev_assets.rb:22:in `each_current_configuration'
/Users/alexfowler/discourse/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.4.7/lib/active_record/tasks/database_tasks.rb:193:in `create_current'
/Users/alexfowler/discourse/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.4.7/lib/active_record/railties/databases.rake:45:in `block (2 levels) in <main>'
/Users/alexfowler/discourse/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/exe/rake:27:in `<top (required)>'
/Users/alexfowler/.rbenv/versions/2.7.6/bin/bundle:23:in `load'
/Users/alexfowler/.rbenv/versions/2.7.6/bin/bundle:23:in `<main>'
Tasks: TOP => db:create
(See full trace by running task with --trace)
2 Likes

Hi,I am installing on m1 Monterey and need some help.

After bundle install is completed, when doing db create, I have the following error saying symbol not found in flat namespace '___aarch64_ldadd4_acq_rel':

bundle exec rake db:create
rake aborted!
LoadError: dlopen(/Users/$USERID/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/rbtrace-0.4.14/lib/rbtrace.bundle, 0x0009): symbol not found in flat namespace '___aarch64_ldadd4_acq_rel' - /Users/$USERID/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/rbtrace-0.4.14/lib/rbtrace.bundle
/Users/$USERID/discourse/config/environments/development.rb:80:in `block in <main>'
/Users/$USERID/discourse/config/environments/development.rb:3:in `<main>'
/Users/$USERID/discourse/config/environment.rb:7:in `<main>'
/Users/$USERID/.rbenv/versions/2.7.3/bin/bundle:25:in `load'
/Users/$USERID/.rbenv/versions/2.7.3/bin/bundle:25:in `<main>'
Tasks: TOP => db:create => db:load_config => environment
(See full trace by running task with --trace)

Thanks!

1 Like

When executing this:

I got this error:

MISCONF Redis is configured to save RDB snapshots, but it is currently not able to persist on disk. Commands that may modify the data set are disabled, because this instance is configured to report errors during writes if RDB snapshotting fails (stop-writes-on-bgsave-error option). Please check the Redis logs for details about the RDB error. ( Redis::CommandError )

Fix this by restarting Redis:

brew services restart redis

and you’ll be fine.

4 Likes

look good! :slight_smile: thank you very much

1 Like

My database creation failed:

connection to server on socket "/tmp/.s.PGSQL.5432" failed: fe_sendauth: no password supplied
Couldn't create 'discourse_development' database. Please check your configuration.

Do I need to provide the user and password for my PostGresql db?

1 Like

it’s been a while so you probably got it working, but for anyone that has the same problem you have to have imagemagick and can use brew install imagemagick like described here

1 Like

A suggestion:

I think there’s value adding this bit in the original guide, since it is a major dependency :thinking:

I was setting up Discourse on a fresh install of Big Sur. When I run bin/ember-cli, I realised that I haven’t installed node yet. From experience, I could figure out what to do. However I imagined a much younger me would not be able to figure it out immediately, and could be a source of unnecessary frustration(s) :pensive:

Something like this?:

Starting with Discourse 2.5+ EmberCLI is required in development and these additional steps will be required:

Open a separate terminal instance.

If you don’t have node, install it is by running:

brew install node

Navigate to your discourse folder (cd ~/discourse) and run:

bin/ember-cli

You should now be able to navigate to http://localhost:4200 to see your local Discourse installation.

3 Likes

2 posts were merged into an existing topic: Beginners Guide to Install Discourse on Ubuntu for Development

When I first followed these directions and ran bundle exec rake db:migrate I received the following error:

rake aborted!
Errno::ENOENT: No such file or directory @ rb_sysopen - /Users/daniel/workspace/discourse/app/assets/javascripts/node_modules/xss/dist/xss.min.js
/Users/daniel/workspace/discourse/lib/pretty_text.rb:612:in `block in ctx_load'
/Users/daniel/workspace/discourse/lib/pretty_text.rb:611:in `each'
/Users/daniel/workspace/discourse/lib/pretty_text.rb:611:in `ctx_load'
/Users/daniel/workspace/discourse/lib/pretty_text.rb:108:in `create_es6_context'
/Users/daniel/workspace/discourse/lib/pretty_text.rb:152:in `block in v8'
/Users/daniel/workspace/discourse/lib/pretty_text.rb:150:in `synchronize'
/Users/daniel/workspace/discourse/lib/pretty_text.rb:150:in `v8'
/Users/daniel/workspace/discourse/lib/pretty_text.rb:304:in `block in escape_emoji'
/Users/daniel/workspace/discourse/lib/pretty_text.rb:605:in `block in protect'
/Users/daniel/workspace/discourse/lib/pretty_text.rb:604:in `synchronize'
/Users/daniel/workspace/discourse/lib/pretty_text.rb:604:in `protect'
/Users/daniel/workspace/discourse/lib/pretty_text.rb:303:in `escape_emoji'
/Users/daniel/workspace/discourse/app/models/emoji.rb:222:in `unicode_unescape'
/Users/daniel/workspace/discourse/app/models/topic.rb:458:in `fancy_title'
/Users/daniel/workspace/discourse/app/models/topic.rb:347:in `block in <class:Topic>'
/Users/daniel/workspace/discourse/app/models/category.rb:300:in `block in create_category_definition'
/Users/daniel/workspace/discourse/app/models/category.rb:295:in `create_category_definition'
/Users/daniel/workspace/discourse/lib/seed_data/categories.rb:114:in `create_category'
/Users/daniel/workspace/discourse/lib/seed_data/categories.rb:15:in `block (2 levels) in create'
/Users/daniel/workspace/discourse/lib/seed_data/categories.rb:15:in `each'
/Users/daniel/workspace/discourse/lib/seed_data/categories.rb:15:in `block in create'
/Users/daniel/workspace/discourse/lib/seed_data/categories.rb:14:in `create'
(eval):6:in `block (2 levels) in run_file'
/Users/daniel/workspace/discourse/lib/tasks/db.rake:152:in `block (2 levels) in <main>'
/Users/daniel/workspace/discourse/lib/distributed_mutex.rb:57:in `block in synchronize'
/Users/daniel/workspace/discourse/lib/distributed_mutex.rb:53:in `synchronize'
/Users/daniel/workspace/discourse/lib/distributed_mutex.rb:53:in `synchronize'
/Users/daniel/workspace/discourse/lib/distributed_mutex.rb:38:in `synchronize'
/Users/daniel/workspace/discourse/lib/tasks/db.rake:132:in `block in <main>'
/Users/daniel/.rbenv/versions/2.7.3/bin/bundle:25:in `load'
/Users/daniel/.rbenv/versions/2.7.3/bin/bundle:25:in `<main>'
Tasks: TOP => db:migrate
(See full trace by running task with --trace)

To resolve this issue I did have to run yarn install before the command.

1 Like

help
Your bundle is locked to webmock (3.16.0) from rubygems repository https://rubygems.org/ or installed locally, but that
version can no longer be found in that source. That means the author of webmock (3.16.0) has removed it. You’ll need to
update your bundle to a version other than webmock (3.16.0) that hasn’t been removed in order to install.

edit: (seems to big a bigger problem here, my bundler says the ruby version is too old and then i update my ruby and it still says it’s old)

2 Likes

I have the same issue. Were you able to resolve this @astro?

1 Like

Please share the output of ruby -v and which ruby on your terminal.

6 Likes

Oops, developer error on this one :man_facepalming:

I didn’t realize I was on a branch that was likely well behind the docker images. After switching to a current branch, I’m good. Hope this helps you out @astro.

1 Like

If you ever encounter a postgresql error starting up your rails server like this
Library not loaded: /opt/homebrew/opt/postgresql/lib/libpq.5.dylib
or (no such file), ‘/usr/local/lib/libpq.5.dylib’

gem uninstall pg
bundle install