<?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: Christopher Sexton</title>
    <description>The latest articles on DEV Community by Christopher Sexton (@csexton).</description>
    <link>https://dev.to/csexton</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%2F198590%2F12b98e3e-75b2-4c58-a801-559933437299.jpeg</url>
      <title>DEV Community: Christopher Sexton</title>
      <link>https://dev.to/csexton</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/csexton"/>
    <language>en</language>
    <item>
      <title>Installing Rails 6 on Heroku Revisited</title>
      <dc:creator>Christopher Sexton</dc:creator>
      <pubDate>Thu, 22 Aug 2019 00:00:00 +0000</pubDate>
      <link>https://dev.to/csexton/installing-rails-6-on-heroku-revisited-14ek</link>
      <guid>https://dev.to/csexton/installing-rails-6-on-heroku-revisited-14ek</guid>
      <description>&lt;p&gt;In my &lt;a href="///2019/08/02/rails-6-on-heroku.html"&gt;original post&lt;/a&gt; I outlined a solution that involved adding a Heroku build pack. But after a discussion on &lt;a href="https://github.com/rails/webpacker/pull/2206"&gt;&lt;code&gt;rails/webpacker&lt;/code&gt;&lt;/a&gt; found a better way to handle this error.&lt;/p&gt;

&lt;p&gt;So if you see this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt; Compilation failed:

 !
 ! Precompiling assets failed.
 !
 ! Push rejected, failed to compile Ruby app.
 ! Push failed

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;I was able to fix the issue by moving the sass packages into the production dependencies instead of the &lt;code&gt;devDependencies&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;I moved the two Sass packages to &lt;code&gt;dependencies&lt;/code&gt;, and it worked:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   "dependencies": {
     "@rails/actioncable": "^6.0.0",
     "@rails/activestorage": "^6.0.0",
     "@rails/ujs": "^6.0.0",
     "@rails/webpacker": "^4.0.2",
     "turbolinks": "^5.2.0",
+ "node-sass": "^4.12.0",
+ "sass-loader": "^7.1.0"
   },
   "devDependencies": {
- "node-sass": "^4.12.0",
- "sass-loader": "^7.1.0",
     "webpack-dev-server": "^3.3.1"
   },

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;This winds up being a better solution because:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;It doesn’t rerun the yarn install (which can take a while, &lt;a href="https://github.com/rails/webpacker/pull/2206#issuecomment-519980678"&gt;even if it is supposed to be fast on subsuquent runs&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;Uses the libraries I expected&lt;/li&gt;
&lt;li&gt;Works with the default Heroku buildpack&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Thanks to &lt;a href="https://github.com/bbugh"&gt;Brian&lt;/a&gt; and &lt;a href="https://github.com/jakeNiemiec"&gt;Jake&lt;/a&gt; for helping me get this sorted. Still a learning process with NPM, Webpack, and friends.&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
