<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: TJ Barber</title>
    <description>The latest articles on DEV Community by TJ Barber (@tjbarber).</description>
    <link>https://dev.to/tjbarber</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F63391%2F86c648f7-ab0c-4dbd-a951-d4713d251846.jpg</url>
      <title>DEV Community: TJ Barber</title>
      <link>https://dev.to/tjbarber</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/tjbarber"/>
    <language>en</language>
    <item>
      <title>Fixing "unable to monitor directories for changes" on Docker for macOS</title>
      <dc:creator>TJ Barber</dc:creator>
      <pubDate>Tue, 28 Jan 2020 20:32:26 +0000</pubDate>
      <link>https://dev.to/tjbarber/fixing-unable-to-monitor-directories-for-changes-on-docker-for-macos-25c0</link>
      <guid>https://dev.to/tjbarber/fixing-unable-to-monitor-directories-for-changes-on-docker-for-macos-25c0</guid>
      <description>&lt;p&gt;Earlier today I ran across this error when trying to run my Docker-ized Ruby on Rails application:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;FATAL: Listen error: unable to monitor directories for changes.&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Obviously, I started Googling. I was confused, because I didn't know if this was my macOS host causing this issue or if it was the Docker container itself. Docker pointed me to &lt;a href="https://github.com/guard/listen/wiki/Increasing-the-amount-of-inotify-watchers"&gt;this page&lt;/a&gt; which seemed like it should offer me the solution, and it &lt;em&gt;kinda&lt;/em&gt; did but not really.&lt;/p&gt;

&lt;p&gt;Through trial and error, I found that macOS doesn't have a &lt;code&gt;sysctl.conf&lt;/code&gt; file by default. I wanted to avoid creating one if at all possible. But I found out that by using &lt;code&gt;docker ssh&lt;/code&gt; I could get to my Docker container's terminal! Once I discovered that, here are the steps I took to resolve the issue:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;SSH into the container using &lt;code&gt;docker ssh&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Run the command provided by &lt;a href="https://github.com/guard/listen/wiki/Increasing-the-amount-of-inotify-watchers"&gt;this page&lt;/a&gt;: &lt;code&gt;echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf &amp;amp;&amp;amp; sudo sysctl -p&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Run &lt;code&gt;sudo sysctl -p&lt;/code&gt; to refresh your kernel parameters.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Re-run the command you were attempting to run and you should be good to go! From here I was able to start my Rails console and all worked as intended.&lt;/p&gt;

</description>
      <category>docker</category>
      <category>macos</category>
      <category>debugging</category>
      <category>web</category>
    </item>
  </channel>
</rss>
