Killing MailCatcher: Something’s using port 1025

In OSX, run the following in a shell: sudo lsof -nP -iTCP:1025 -sTCP:LISTEN The expected output of this command is a process, which is listening on port 1025: ruby 43841 youruserid 9u IPv4 0x6a1610da80bb9b4f 0t0 TCP 127.0.0.1:1025 (LISTEN) In the output above, the 2nd value is the process ID. Then, to kill the offending process … Read more

django setting environment variables in unittest tests

The test.support.EnvironmentVarGuard is an internal API that might be changed from version to version with breaking (backward incompatible) changes. In fact, the entire test package is internal use only. It was explicitly stated on the test package documentation page that it’s for internal testing of core libraries and NOT a public API. (see links below) … Read more

Is there a comment character for foreman’s .env file?

FWIW, ‘#’ appears to work as a comment character. It at least has the effect of removing unwanted environment declarations. It might be declaring others starting with a #, but… it still works. EG DATABASE_URL=postgres://mgregory:@localhost/mgregory #DATABASE_URL=mysql://root:secret@localhost:3306/cm_central results in postgres being used by django when started by foreman with this .env file, which is what I … Read more

foreman only shows line with “started with pid #” and nothing else

I’ve been able to resolve this issue by 2 different ways: From https://github.com/ddollar/foreman/wiki/Missing-Output: If you are not seeing any output from your program, there is a likely chance that it is buffering stdout. Ruby buffers stdout by default. To disable this behavior, add this code as early as possible in your program: # ruby $stdout.sync … Read more

Foreman: Use different Procfile in development and production

You could use two Procfiles (e.g. Procfile and Procfile.dev) and use foremans -f option to select a different one to use in dev: In dev (Procfile.dev contains your shotgun web process): foreman start -f Procfile.dev In production, foreman start will pick up the normal Procfile. Alternatively you could create a bin directory in your app … Read more