Note that there are some explanatory texts on larger screens.

plurals
  1. PORails Assets Not Compiled in Production
    primarykey
    data
    text
    <p>Here's the error:</p> <pre><code>Processing by LandingPageController#index as HTML Rendered landing_page/index.html.erb within layouts/application (2.1ms) Completed 500 Internal Server Error in 49ms ActionView::Template::Error (landing_page.css isn't precompiled): 12: &lt;![endif]--&gt; 13: 14: &lt;%= stylesheet_link_tag "application", :media =&gt; "all" %&gt; 15: &lt;%= stylesheet_link_tag params[:controller] %&gt; 16: 17: &lt;/head&gt; 18: &lt;body&gt; app/views/layouts/application.html.erb:15:in `_app_views_layouts_application_html_erb__3002306950342527375_29178380' </code></pre> <p>I can see that it's looking for the landing_page.css file because of line 15. What I don't understand is what is what is the best way to have this asset precompiled for production. I have tried modifying /config/application.rb:</p> <pre><code>config.assets.precompile += ['landing_page.css'] </code></pre> <p>This doesn't seem right to me. I'd have to do this for every single stylesheet which would be annoying.</p> <p>I added code to the application.css manifest:</p> <pre><code>*= require landing_page </code></pre> <p>This doesn't seem to work. I get the first error when I do this and don't modify the application config file.</p> <p>I'm stumped as to how you can include the line</p> <pre><code>&lt;%= stylesheet_link_tag params[:controller] %&gt; </code></pre> <p>in your layout and have your assets precompiled for production when you run</p> <pre><code>bundle exec rake assets:precompile </code></pre> <p>I feel like I'm missing some simple trick that automatically adds the auto-generated stylesheets and javascript files to the list of files to be precompiled when you run the rake task.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload