MacOS install / .discourse-setup / bad script

(Logan Donaldson) #1

MacOS 10.13.4 / XCode 9.3 / Docker 18.03.0-CE-mac60

On a fresh installation, the setup is failing at line 114

./discourse-setup: line 114: [: 6400M: integer expression expected
./discourse-setup: line 123: [: 6400M: integer expression expected
The configuration file containers/app.yml already exists!
./discourse-setup: line 195: [: 6506M: integer expression expected
./discourse-setup: line 199: [: 6506M: integer expression expected
./discourse-setup: line 203: 256 * 6506M: value too great for base (error token is "6506M")
./launcher: line 204: /1024**3 < 5: syntax error: operand expected (error token is "/1024**3 &lt; 5")

Perhaps, the setup/launch script is pulling a variable that is different in MacOS than linux.

thank you !

(Jeff Atwood) #2

Running in production on MacOS is not supported, you’d need something like Ubuntu for that. Are you sure you are not setting up a development environment?

(Logan Donaldson) #3

The discourse distribution was obtained from github

git clone /var/discourse

as described in the example

(Logan Donaldson) #4

is there a vmware or virtualbox image of a working ubuntu production setup?

(Jeff Atwood) #5

You can install a production site in any cloud in under 30 minutes by following our official install guide.

(Jay Pfaffman) #6

Well, it appears that the test for checking memory size isn’t doing what someone once thought it did.

  echo `top -l 1 | awk '/PhysMem:/ {print $2}' | sed s/G//`


  echo `top -l 1 | awk '/PhysMem:/ {print $2}' | sed s/[GM]//`

That should solve that problem, and if it does, let me know.


No. That won’t work. Why they tried to get memory with top is beyond me. If you wanted it to work, you’d need to find some way to fix that check_osx_memory function to return the memory size in GB.

But even if you fixed that, I have no idea whether it will actually install Discourse on a Mac, but inexplicably someone once got the PR accepted that tries to make it work on MacOS, so it might.

As described in posts above, if you really want Discourse to work, it’s easiest to just spin up a Digital Ocean droplet and run it there. And yes, you’ll need a domain name.

(Kane York) #7

Uh, what. Using top to get memory. ???

system_profiler SPHardwareDataType | awk '/Memory:/ {print $2}'
sysctl -n hw.memsize

edit: macos doesn’t have free(1)

But also, why are you running discourse-setup on a Mac in the first place.

(Jay Pfaffman) #8

Thanks! I’ll add that to my growing list of updates to make to discourse-setup.

(Logan Donaldson) #9

Perhaps a note on your site for potential new users that Discourse won’t run on a Mac. It looked possible since all of the other bits are available (docker, git, web services).

Re: the reply to just use third party services - that won’t fly with the users with a tiny academic forum that I hoped to create. I had a running OSX server already and Discourse seemed like a good option because finding and configuring a linux box, registering a MAC address with my univ along with begging for a static IP seemed like a lot more work.

(Jeff Atwood) #10

Nobody wants to run a production forum on a Mac, so this is a nonsensical thing to ask for. If you want to develop on a Mac, there is an existing topic on that.