CSS Stylesheet not working using Ruby on Rails: Sprockets::Rails::Helper::AssetNotFound ErrorHow can I “pretty” format my JSON output in Ruby on Rails?A concise explanation of nil v. empty v. blank in Ruby on RailsHow can I rename a database column in a Ruby on Rails migration?How do I get the current absolute URL in Ruby on Rails?Ruby on Rails Server optionsHow do CSS triangles work?sass-rails helpers “image-url”, “asset-url” are not working in rails 3.2.1Getting sprockets error when using jekyll-assetsSprockets::Rails::Helper::AssetNotFound in Projects#show

How to add a table description to a longtable?

Gofer work in exchange for Letter of Recommendation

Why do balloons get cold when they deflate?

Why do aircraft leave cruising altitude long before landing just to circle?

Starships without computers?

What causes burn marks on the air handler in the attic?

Will some rockets really collapse under their own weight?

Does the Temple of the Gods spell nullify critical hits?

Have made several mistakes during the course of my PhD. Can't help but feel resentment. Can I get some advice about how to move forward?

Are there any OR challenges that are similar to kaggle's competitions?

Postdoc interview - somewhat positive reply but no news?

Are there categories whose internal hom is somewhat 'exotic'?

Build a mob of suspiciously happy lenny faces ( ͡° ͜ʖ ͡°)

Repurpose telephone line to ethernet

Is there a way to make the "o" keypress of other-window <C-x><C-o> repeatable?

Did Wernher von Braun really have a "Saturn V painted as the V2"?

Does git delete empty folders?

Virtual destructor moves object out of rodata section

To plot branch cut of logarithm

Can I submit a paper computer science conference using an alias if using my real name can cause legal trouble in my original country

What allows us to use imaginary numbers?

What should I do with the stock I own if I anticipate there will be a recession?

Earliest evidence of objects intended for future archaeologists?

Playing a fast but quiet Alberti bass



CSS Stylesheet not working using Ruby on Rails: Sprockets::Rails::Helper::AssetNotFound Error


How can I “pretty” format my JSON output in Ruby on Rails?A concise explanation of nil v. empty v. blank in Ruby on RailsHow can I rename a database column in a Ruby on Rails migration?How do I get the current absolute URL in Ruby on Rails?Ruby on Rails Server optionsHow do CSS triangles work?sass-rails helpers “image-url”, “asset-url” are not working in rails 3.2.1Getting sprockets error when using jekyll-assetsSprockets::Rails::Helper::AssetNotFound in Projects#show






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








1















I'm trying to add a CSS file to my rails project. I created a file called style.css and placed it in /project/public.
In my view file (index.html.erb) I added the following line of code:



<%= stylesheet_link_tag "style" %>


When I run rails server I get the following error:



 Sprockets::Rails::Helper::AssetNotFound in Articles#index
Showing /mnt/c/code/blog/app/views/articles/index.html where line #34

raised:

The asset **"style.css"** is not present in the asset pipeline.


How can I fix this issue?










share|improve this question


























  • are you requiring it inside manifest? like this? //= require <path to file> ? and why is it in project/public and not in assets/vendor folder as intended?

    – FedeSc
    Mar 27 at 14:45












  • no I'm not adding it, there's no vendor folder in assets

    – Rima
    Mar 27 at 14:47


















1















I'm trying to add a CSS file to my rails project. I created a file called style.css and placed it in /project/public.
In my view file (index.html.erb) I added the following line of code:



<%= stylesheet_link_tag "style" %>


When I run rails server I get the following error:



 Sprockets::Rails::Helper::AssetNotFound in Articles#index
Showing /mnt/c/code/blog/app/views/articles/index.html where line #34

raised:

The asset **"style.css"** is not present in the asset pipeline.


How can I fix this issue?










share|improve this question


























  • are you requiring it inside manifest? like this? //= require <path to file> ? and why is it in project/public and not in assets/vendor folder as intended?

    – FedeSc
    Mar 27 at 14:45












  • no I'm not adding it, there's no vendor folder in assets

    – Rima
    Mar 27 at 14:47














1












1








1








I'm trying to add a CSS file to my rails project. I created a file called style.css and placed it in /project/public.
In my view file (index.html.erb) I added the following line of code:



<%= stylesheet_link_tag "style" %>


When I run rails server I get the following error:



 Sprockets::Rails::Helper::AssetNotFound in Articles#index
Showing /mnt/c/code/blog/app/views/articles/index.html where line #34

raised:

The asset **"style.css"** is not present in the asset pipeline.


How can I fix this issue?










share|improve this question
















I'm trying to add a CSS file to my rails project. I created a file called style.css and placed it in /project/public.
In my view file (index.html.erb) I added the following line of code:



<%= stylesheet_link_tag "style" %>


When I run rails server I get the following error:



 Sprockets::Rails::Helper::AssetNotFound in Articles#index
Showing /mnt/c/code/blog/app/views/articles/index.html where line #34

raised:

The asset **"style.css"** is not present in the asset pipeline.


How can I fix this issue?







html css ruby-on-rails ruby






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 27 at 14:41







Rima

















asked Mar 27 at 13:57









RimaRima

45 bronze badges




45 bronze badges















  • are you requiring it inside manifest? like this? //= require <path to file> ? and why is it in project/public and not in assets/vendor folder as intended?

    – FedeSc
    Mar 27 at 14:45












  • no I'm not adding it, there's no vendor folder in assets

    – Rima
    Mar 27 at 14:47


















  • are you requiring it inside manifest? like this? //= require <path to file> ? and why is it in project/public and not in assets/vendor folder as intended?

    – FedeSc
    Mar 27 at 14:45












  • no I'm not adding it, there's no vendor folder in assets

    – Rima
    Mar 27 at 14:47

















are you requiring it inside manifest? like this? //= require <path to file> ? and why is it in project/public and not in assets/vendor folder as intended?

– FedeSc
Mar 27 at 14:45






are you requiring it inside manifest? like this? //= require <path to file> ? and why is it in project/public and not in assets/vendor folder as intended?

– FedeSc
Mar 27 at 14:45














no I'm not adding it, there's no vendor folder in assets

– Rima
Mar 27 at 14:47






no I'm not adding it, there's no vendor folder in assets

– Rima
Mar 27 at 14:47













3 Answers
3






active

oldest

votes


















0















The asset "style.css" is not present in the asset pipeline.




This message means you haven't included your file in corresponding folder to interact with assets pipeline (/project/public).



In order to work with assets pipeline you have to follow a few rules:



first:



Put it in inteded folder (vendor or assets or lib) this are three different folders in your project folder that assets pipeline is designed to search for files declared in manifest or called individualy with stylesheet_link_tag.



then:



Call it with stylesheet_link_tag.



Read more about assets pipeline search-path https://guides.rubyonrails.org/asset_pipeline.html#search-paths



side note:



you could also use the application manifest which rails provides assets/application.css and assets/application.js and call it in your html instead of calling each file seperatly .. which is kind of the intention of assets pipeline.



as written:




The asset pipeline provides a framework to concatenate and minify or compress JavaScript and CSS assets. It also adds the ability to write these assets in other languages and pre-processors such as CoffeeScript, Sass and ERB. It allows assets in your application to be automatically combined with assets from other gems.




you are missing all this builtin goods when not declaring you files in manifest.



more read https://guides.rubyonrails.org/asset_pipeline.html#manifest-files-and-directives






share|improve this answer


































    0














    You can check more about assets in the guidelines



    Basically, Rails is searching for the assets, inside an application in one of three locations: app/assets, lib/assets or vendor/assets. You have to put the .css file in one of these locations.



    app/assets is for assets that are owned by the application, such as custom images, JavaScript files or stylesheets.

    lib/assets is for your own libraries' code that doesn't really fit into the scope of the application or those libraries which are shared across applications.

    vendor/assets is for assets that are owned by outside entities, such as code for JavaScript plugins and CSS frameworks. Keep in mind that third party code with references to other files also processed by the asset Pipeline (images, stylesheets, etc.), will need to be rewritten to use helpers like asset_path.





    share|improve this answer


































      -1














      What worked:



      1. I copied the contents of style.css and saved them as style.css.scss


      2. I saved the new file in /project/app/assets/stylesheets






      share|improve this answer



























        Your Answer






        StackExchange.ifUsing("editor", function ()
        StackExchange.using("externalEditor", function ()
        StackExchange.using("snippets", function ()
        StackExchange.snippets.init();
        );
        );
        , "code-snippets");

        StackExchange.ready(function()
        var channelOptions =
        tags: "".split(" "),
        id: "1"
        ;
        initTagRenderer("".split(" "), "".split(" "), channelOptions);

        StackExchange.using("externalEditor", function()
        // Have to fire editor after snippets, if snippets enabled
        if (StackExchange.settings.snippets.snippetsEnabled)
        StackExchange.using("snippets", function()
        createEditor();
        );

        else
        createEditor();

        );

        function createEditor()
        StackExchange.prepareEditor(
        heartbeatType: 'answer',
        autoActivateHeartbeat: false,
        convertImagesToLinks: true,
        noModals: true,
        showLowRepImageUploadWarning: true,
        reputationToPostImages: 10,
        bindNavPrevention: true,
        postfix: "",
        imageUploader:
        brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
        contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
        allowUrls: true
        ,
        onDemand: true,
        discardSelector: ".discard-answer"
        ,immediatelyShowMarkdownHelp:true
        );



        );













        draft saved

        draft discarded


















        StackExchange.ready(
        function ()
        StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55379018%2fcss-stylesheet-not-working-using-ruby-on-rails-sprocketsrailshelperassetn%23new-answer', 'question_page');

        );

        Post as a guest















        Required, but never shown

























        3 Answers
        3






        active

        oldest

        votes








        3 Answers
        3






        active

        oldest

        votes









        active

        oldest

        votes






        active

        oldest

        votes









        0















        The asset "style.css" is not present in the asset pipeline.




        This message means you haven't included your file in corresponding folder to interact with assets pipeline (/project/public).



        In order to work with assets pipeline you have to follow a few rules:



        first:



        Put it in inteded folder (vendor or assets or lib) this are three different folders in your project folder that assets pipeline is designed to search for files declared in manifest or called individualy with stylesheet_link_tag.



        then:



        Call it with stylesheet_link_tag.



        Read more about assets pipeline search-path https://guides.rubyonrails.org/asset_pipeline.html#search-paths



        side note:



        you could also use the application manifest which rails provides assets/application.css and assets/application.js and call it in your html instead of calling each file seperatly .. which is kind of the intention of assets pipeline.



        as written:




        The asset pipeline provides a framework to concatenate and minify or compress JavaScript and CSS assets. It also adds the ability to write these assets in other languages and pre-processors such as CoffeeScript, Sass and ERB. It allows assets in your application to be automatically combined with assets from other gems.




        you are missing all this builtin goods when not declaring you files in manifest.



        more read https://guides.rubyonrails.org/asset_pipeline.html#manifest-files-and-directives






        share|improve this answer































          0















          The asset "style.css" is not present in the asset pipeline.




          This message means you haven't included your file in corresponding folder to interact with assets pipeline (/project/public).



          In order to work with assets pipeline you have to follow a few rules:



          first:



          Put it in inteded folder (vendor or assets or lib) this are three different folders in your project folder that assets pipeline is designed to search for files declared in manifest or called individualy with stylesheet_link_tag.



          then:



          Call it with stylesheet_link_tag.



          Read more about assets pipeline search-path https://guides.rubyonrails.org/asset_pipeline.html#search-paths



          side note:



          you could also use the application manifest which rails provides assets/application.css and assets/application.js and call it in your html instead of calling each file seperatly .. which is kind of the intention of assets pipeline.



          as written:




          The asset pipeline provides a framework to concatenate and minify or compress JavaScript and CSS assets. It also adds the ability to write these assets in other languages and pre-processors such as CoffeeScript, Sass and ERB. It allows assets in your application to be automatically combined with assets from other gems.




          you are missing all this builtin goods when not declaring you files in manifest.



          more read https://guides.rubyonrails.org/asset_pipeline.html#manifest-files-and-directives






          share|improve this answer





























            0












            0








            0








            The asset "style.css" is not present in the asset pipeline.




            This message means you haven't included your file in corresponding folder to interact with assets pipeline (/project/public).



            In order to work with assets pipeline you have to follow a few rules:



            first:



            Put it in inteded folder (vendor or assets or lib) this are three different folders in your project folder that assets pipeline is designed to search for files declared in manifest or called individualy with stylesheet_link_tag.



            then:



            Call it with stylesheet_link_tag.



            Read more about assets pipeline search-path https://guides.rubyonrails.org/asset_pipeline.html#search-paths



            side note:



            you could also use the application manifest which rails provides assets/application.css and assets/application.js and call it in your html instead of calling each file seperatly .. which is kind of the intention of assets pipeline.



            as written:




            The asset pipeline provides a framework to concatenate and minify or compress JavaScript and CSS assets. It also adds the ability to write these assets in other languages and pre-processors such as CoffeeScript, Sass and ERB. It allows assets in your application to be automatically combined with assets from other gems.




            you are missing all this builtin goods when not declaring you files in manifest.



            more read https://guides.rubyonrails.org/asset_pipeline.html#manifest-files-and-directives






            share|improve this answer
















            The asset "style.css" is not present in the asset pipeline.




            This message means you haven't included your file in corresponding folder to interact with assets pipeline (/project/public).



            In order to work with assets pipeline you have to follow a few rules:



            first:



            Put it in inteded folder (vendor or assets or lib) this are three different folders in your project folder that assets pipeline is designed to search for files declared in manifest or called individualy with stylesheet_link_tag.



            then:



            Call it with stylesheet_link_tag.



            Read more about assets pipeline search-path https://guides.rubyonrails.org/asset_pipeline.html#search-paths



            side note:



            you could also use the application manifest which rails provides assets/application.css and assets/application.js and call it in your html instead of calling each file seperatly .. which is kind of the intention of assets pipeline.



            as written:




            The asset pipeline provides a framework to concatenate and minify or compress JavaScript and CSS assets. It also adds the ability to write these assets in other languages and pre-processors such as CoffeeScript, Sass and ERB. It allows assets in your application to be automatically combined with assets from other gems.




            you are missing all this builtin goods when not declaring you files in manifest.



            more read https://guides.rubyonrails.org/asset_pipeline.html#manifest-files-and-directives







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Mar 27 at 15:46

























            answered Mar 27 at 14:50









            FedeScFedeSc

            1,15711 silver badges29 bronze badges




            1,15711 silver badges29 bronze badges


























                0














                You can check more about assets in the guidelines



                Basically, Rails is searching for the assets, inside an application in one of three locations: app/assets, lib/assets or vendor/assets. You have to put the .css file in one of these locations.



                app/assets is for assets that are owned by the application, such as custom images, JavaScript files or stylesheets.

                lib/assets is for your own libraries' code that doesn't really fit into the scope of the application or those libraries which are shared across applications.

                vendor/assets is for assets that are owned by outside entities, such as code for JavaScript plugins and CSS frameworks. Keep in mind that third party code with references to other files also processed by the asset Pipeline (images, stylesheets, etc.), will need to be rewritten to use helpers like asset_path.





                share|improve this answer































                  0














                  You can check more about assets in the guidelines



                  Basically, Rails is searching for the assets, inside an application in one of three locations: app/assets, lib/assets or vendor/assets. You have to put the .css file in one of these locations.



                  app/assets is for assets that are owned by the application, such as custom images, JavaScript files or stylesheets.

                  lib/assets is for your own libraries' code that doesn't really fit into the scope of the application or those libraries which are shared across applications.

                  vendor/assets is for assets that are owned by outside entities, such as code for JavaScript plugins and CSS frameworks. Keep in mind that third party code with references to other files also processed by the asset Pipeline (images, stylesheets, etc.), will need to be rewritten to use helpers like asset_path.





                  share|improve this answer





























                    0












                    0








                    0







                    You can check more about assets in the guidelines



                    Basically, Rails is searching for the assets, inside an application in one of three locations: app/assets, lib/assets or vendor/assets. You have to put the .css file in one of these locations.



                    app/assets is for assets that are owned by the application, such as custom images, JavaScript files or stylesheets.

                    lib/assets is for your own libraries' code that doesn't really fit into the scope of the application or those libraries which are shared across applications.

                    vendor/assets is for assets that are owned by outside entities, such as code for JavaScript plugins and CSS frameworks. Keep in mind that third party code with references to other files also processed by the asset Pipeline (images, stylesheets, etc.), will need to be rewritten to use helpers like asset_path.





                    share|improve this answer















                    You can check more about assets in the guidelines



                    Basically, Rails is searching for the assets, inside an application in one of three locations: app/assets, lib/assets or vendor/assets. You have to put the .css file in one of these locations.



                    app/assets is for assets that are owned by the application, such as custom images, JavaScript files or stylesheets.

                    lib/assets is for your own libraries' code that doesn't really fit into the scope of the application or those libraries which are shared across applications.

                    vendor/assets is for assets that are owned by outside entities, such as code for JavaScript plugins and CSS frameworks. Keep in mind that third party code with references to other files also processed by the asset Pipeline (images, stylesheets, etc.), will need to be rewritten to use helpers like asset_path.






                    share|improve this answer














                    share|improve this answer



                    share|improve this answer








                    edited Mar 27 at 21:29

























                    answered Mar 27 at 14:48









                    mmsilviummsilviu

                    4253 silver badges14 bronze badges




                    4253 silver badges14 bronze badges
























                        -1














                        What worked:



                        1. I copied the contents of style.css and saved them as style.css.scss


                        2. I saved the new file in /project/app/assets/stylesheets






                        share|improve this answer





























                          -1














                          What worked:



                          1. I copied the contents of style.css and saved them as style.css.scss


                          2. I saved the new file in /project/app/assets/stylesheets






                          share|improve this answer



























                            -1












                            -1








                            -1







                            What worked:



                            1. I copied the contents of style.css and saved them as style.css.scss


                            2. I saved the new file in /project/app/assets/stylesheets






                            share|improve this answer













                            What worked:



                            1. I copied the contents of style.css and saved them as style.css.scss


                            2. I saved the new file in /project/app/assets/stylesheets







                            share|improve this answer












                            share|improve this answer



                            share|improve this answer










                            answered Mar 28 at 11:27









                            RimaRima

                            45 bronze badges




                            45 bronze badges






























                                draft saved

                                draft discarded
















































                                Thanks for contributing an answer to Stack Overflow!


                                • Please be sure to answer the question. Provide details and share your research!

                                But avoid


                                • Asking for help, clarification, or responding to other answers.

                                • Making statements based on opinion; back them up with references or personal experience.

                                To learn more, see our tips on writing great answers.




                                draft saved


                                draft discarded














                                StackExchange.ready(
                                function ()
                                StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55379018%2fcss-stylesheet-not-working-using-ruby-on-rails-sprocketsrailshelperassetn%23new-answer', 'question_page');

                                );

                                Post as a guest















                                Required, but never shown





















































                                Required, but never shown














                                Required, but never shown












                                Required, but never shown







                                Required, but never shown

































                                Required, but never shown














                                Required, but never shown












                                Required, but never shown







                                Required, but never shown







                                Popular posts from this blog

                                Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

                                Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

                                Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript