When you start to run you newly build applictaion of ruby on rails you can came across the precompilation error.

like: Error ActionView::Template::Error (application.css isn’t precompiled):

ActionView::Template::Error (application.css isn't precompiled):
    2: <html>
    3: <head>
    4:   <title>Myapp</title>
    5:   <%= stylesheet_link_tag    "application", :media => "all" %>
    6:   <%= javascript_include_tag "application" %>
    7:   <%= csrf_meta_tags %>
    8: </head>

This error is very common with the budding rails developer and it has a very simple solution too. To solve this error go to my_app/config/environments/production.rb

config.assets.compile = true

this will solve the purpose.

In case if you are using different environment like development or test then visit:

my_app/config/environments/development.rb

or

my_app/config/environments/production.rb

and do the same as above

Advertisements

One thought on “When you start to run you newly build applictaion of ruby on rails you can came across the precompilation error.

Add yours

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com.

Up ↑

%d bloggers like this: