title: Rails 6.1.1 doesn't load the webpacker created CSS files in production mode
body: <p>this is my first time asking a question here, I hope I would explain my problem well.
  In one of my recent tasks, I'm upgrading our app to Ruby and Rails (Ruby 2.6.6 &gt; 2.7.2, Rails 6.0.3.2. &gt; 6.1.1)
  I had several issues along the way, upgraded some gems and JS libraries. The application runs fine in <code>development</code> mode. However when I switch to <code>production</code> mode, I run these commands to compile and run the server.</p>
  <pre><code>RAILS_ENV=production bundle exec rake webpacker:compile
  ./node_modules/webpack/bin/webpack.js --config webpack.config.js
  </code></pre>
  <p>When I run the app, in <code>production</code> mode it looks running normal, but when I go to <code>localhost:3000</code> it throws several <code>500</code> errors regarding to CSS files. I see the main page of the app as plain HTML, without CSS.</p>
  <pre><code>2021-01-22 11:50:51 -0500 Rack app (&quot;GET /assets/stylesheets/app-styles-3661efb317da3fb28f52.css&quot; - (127.0.0.1)): #&lt;NoMethodError: undefined method `match?' for #&lt;ActionDispatch::FileHandler:0x00007ff610502c20&gt;&gt;
  2021-01-22 11:50:25 -0500 Rack app (&quot;GET /assets/landing.debug-05588bd014e46c264aaf6e00d2f5c570dd7ca3ed42336c2ff6d5c05bf986afe2.js&quot; - (127.0.0.1)): #&lt;NoMethodError: undefined method `match?' for #&lt;ActionDispatch::FileHandler:0x00007ff610502c20&gt;&gt;
  2021-01-22 11:50:25 -0500 Rack app (&quot;GET /assets/companyLogo-6700adf796812269b9428251803c253b9c073095ef511d3619d269a0fdd96435.png&quot; - (127.0.0.1)): #&lt;NoMethodError: undefined method `match?' for #&lt;ActionDispatch::FileHandler:0x00007ff610502c20&gt;&gt;
  </code></pre>
  <p>Files which are mentioned in the error are exists under the <code>/public</code> folder. In the browser's page source, I can see the path as well. When I click the folder path on page source, I see this error on the browser.
  <code>An unhandled lowlevel error occurred. The application logs may have details.</code></p>
  <p>When I check the <a href="https://api.rubyonrails.org/v6.1.1/classes/ActionDispatch/FileHandler.html" rel="nofollow noreferrer">docs</a> of RoR, the <code>match?</code> method for <code>ActionDispatch::FileHandler</code> is not there, but in <a href="https://api.rubyonrails.org/v6.0.3.2/classes/ActionDispatch/FileHandler.html" rel="nofollow noreferrer">6.0.3.2 docs</a>, it is deprecated without a notice, maybe.?. It is <strong>not</strong> something I call intentionally, it is probably called somewhere in Rails when the app is running on <code>production</code> mode.</p>
  <p>I have those helper in my erb files.</p>
  <pre><code>&lt;%= javascript_pack_tag 'application' %&gt;
  &lt;%= stylesheet_pack_tag 'application' %&gt;
  </code></pre>
  <p>I tried replacing them with</p>
  <pre><code>&lt;%= stylesheet_pack_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %&gt;
  &lt;%= javascript_pack_tag 'application', 'data-turbolinks-track': 'reload' %&gt;
  </code></pre>
  <p>but no luck :(</p>
  <p>I tried <a href="https://stackoverflow.com/a/55182971/10484895">this</a> as well.</p>
  <p>Is anyone have an idea how can I make sure Rails is loading these files and accessible in the user side? Or any better debugging suggestions are appreciated!
  Thanks in advance!</p>
  <p>Note: When I switch to <code>development</code> mode, everything works fine.
  BTW, Some Packages I use:</p>
  <pre><code>&quot;@rails/webpacker&quot;: &quot;5.2.1&quot; #-&gt; was 4.0.2
  &quot;webpack-bundle-analyzer&quot;: &quot;3.3.2&quot;
  &quot;webpack-manifest-plugin&quot;: &quot;3.0.0-rc.0&quot; #-&gt; was 2.0.4
  &quot;webpack-cli&quot;: &quot;4.4.0&quot;, #-&gt; was 3.3.0 and it was only devDependency
  </code></pre>