DEV Community

Perafán
Perafán

Posted on • Edited on

3 3

Install nginx with passenger in MacOS Monterey

Maybe if you have installed nginx and upgrade to the new macos monterrey you could have an issue starting nginx.

objc[65203]: +[__NSCFConstantString initialize] may have been in progress in another thread when fork() was called.
objc[65203]: +[__NSCFConstantString initialize] may have been in progress in another thread when fork() was called. We cannot safely call it or ignore it in the fork() child process. Crashing instead. Set a breakpoint on objc_initializeAfterForkError to debug.
Enter fullscreen mode Exit fullscreen mode

First we need to remove nginx

brew uninstall nginx # uninstall nginx-full
rm -rf /usr/local/etc/nginx
Enter fullscreen mode Exit fullscreen mode

Now we should reinstall nginx

brew tap denji/nginx
brew install nginx-full --with-passenger
Enter fullscreen mode Exit fullscreen mode

Edit your nginx.confg (/usr/local/etc/nginx/nginx.conf) and add the following code in the http scope:

passenger_root /usr/local/opt/passenger/libexec/src/ruby_supportlib/phusion_passenger/locations.ini;
passenger_ruby /usr/bin/ruby;
passenger_env_var OBJC_DISABLE_INITIALIZE_FORK_SAFETY YES;

### If you're using rbenv passenger_ruby /Users/user/.rbenv/shims/ruby;
Enter fullscreen mode Exit fullscreen mode

Sentry image

Hands-on debugging session: instrument, monitor, and fix

Join Lazar for a hands-on session where you’ll build it, break it, debug it, and fix it. You’ll set up Sentry, track errors, use Session Replay and Tracing, and leverage some good ol’ AI to find and fix issues fast.

RSVP here →

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay