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;
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
add a comment |
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
are you requiring it inside manifest? like this?//= require <path to file>
? and why is it inproject/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
add a comment |
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
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
html css ruby-on-rails ruby
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 inproject/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
add a comment |
are you requiring it inside manifest? like this?//= require <path to file>
? and why is it inproject/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
add a comment |
3 Answers
3
active
oldest
votes
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
add a comment |
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.
add a comment |
What worked:
I copied the contents of style.css and saved them as style.css.scss
I saved the new file in /project/app/assets/stylesheets
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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
add a comment |
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
add a comment |
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
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
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
add a comment |
add a comment |
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.
add a comment |
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.
add a comment |
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.
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.
edited Mar 27 at 21:29
answered Mar 27 at 14:48
mmsilviummsilviu
4253 silver badges14 bronze badges
4253 silver badges14 bronze badges
add a comment |
add a comment |
What worked:
I copied the contents of style.css and saved them as style.css.scss
I saved the new file in /project/app/assets/stylesheets
add a comment |
What worked:
I copied the contents of style.css and saved them as style.css.scss
I saved the new file in /project/app/assets/stylesheets
add a comment |
What worked:
I copied the contents of style.css and saved them as style.css.scss
I saved the new file in /project/app/assets/stylesheets
What worked:
I copied the contents of style.css and saved them as style.css.scss
I saved the new file in /project/app/assets/stylesheets
answered Mar 28 at 11:27
RimaRima
45 bronze badges
45 bronze badges
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
are you requiring it inside manifest? like this?
//= require <path to file>
? and why is it inproject/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