Installing Mailcatcher on OSX El Capitan with SIP enabled
Due to new restrictions on El Capitan , sudo gem install
can't install stuff in system directories (like /usr/bin
).
$ sudo gem install mailcatcher
ERROR: While executing gem ... (Errno::EPERM)
Operation not permitted - /usr/bin/mailcatcher
A workaround is to install the gem in some writeable place - here, in /usr/local/bin
.
1 . Install the gem:
$ gem install -n /usr/local/bin mailcatcher
2 . Add the directory to your $PATH
, if not already present:
export PATH="/usr/local/bin:${PATH}"
3 . Configure your php.ini
with the right path:
sendmail_path = /usr/local/bin/catchmail -f [email protected]
Using the absolute path of catchmail
is needed if you are using PHP with Apache, because in this context the $PATH
is not available.
4 . Launch mailcatcher
as usual:
$ mailcatcher
Starting MailCatcher
==> smtp://127.0.0.1:1025
==> http://127.0.0.1:1080
*** MailCatcher runs as a daemon by default. Go to the web interface to quit.