开发者

Can't get asset pipeline working

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.

Any ideas?

Note: using sprockets 2.0.0.beta.15


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


You might find that adding

config.serve_static_assets = true

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


To be more exact, add this to your Gemfile

gem 'sprockets/railtie'
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜