No se puede hacer funcionar la canalización de activos

I can't get the asset pipeline working for some reason. I get a 404 on request to both application.css and application.js. I'm using rails 3.1.0.rc6. Nothing special, just created a new project.

In my layout file:

<%= stylesheet_link_tag    "application" %>
<%= javascript_include_tag "application" %>

It's linking to /stylesheets/application.css and same with the js file. I'm using pow but also tried starting the server with webrick.

¿Alguna idea?

Note: using sprockets 2.0.0.beta.15

preguntado el 27 de agosto de 11 a las 17:08

I've also noticed that I'm missing the rake tasks for assets. -

3 Respuestas

Figured it out. I had to make an explicit require call to "sprockets/railtie"

Respondido 29 ago 11, 03:08

You might find that adding

config.serve_static_assets = true

to your config/environments/xxx.rb will help.

Respondido 29 ago 11, 07:08

To be more exact, add this to your Gemfile

gem 'sprockets/railtie'

Respondido 01 Oct 12, 15:10

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.