简体   繁体   English

rails 3.1资产不可用

[英]rails 3.1 assets are not available

I started playing around with rails 3.1.rc4 but the first problem I'm having is that the assets are not available. 我开始玩Rails 3.1.rc4,但遇到的第一个问题是资产不可用。 I created a brand new project and in the index page the rails image gives 404. Actually any assets are available. 我创建了一个全新的项目,在索引页面中,rails图像给出了404。实际上任何资产都可用。

I checked 我检查了

# application.rb
# Enable the asset pipeline
config.assets.enabled = true

And I tried 我试过了

config.assets.paths << "#{Rails.root}/app/assets/images"

and also from the shell 以及从外壳

$ rake rails:update
$ rake assets:clean
$ rake assets:precompile

had no luck, so I destroyed the gemset and I made another one reinstalling rails, but nothing worked so far. 运气不好,所以我销毁了宝石,然后又做了一个重新安装滑轨的装置,但到目前为止没有任何效果。

Any ideas? 有任何想法吗? - thank you - 谢谢

I had the same problem and resolved it by forcing Rails to use sprockets beta10 instead of beta12 in the Gemfile: 我遇到了同样的问题,并通过强制Rails在Gemfile中使用链轮beta10而不是beta12来解决了这个问题:

gem 'sprockets', '2.0.0.beta.10'

And then running 然后运行

bundle update sprockets

Another fix might be to install Rails 3.1.0rc5. 另一个修复可能是安装Rails 3.1.0rc5。 The problem seems to be incompatibility between Rails and Sprockets and is detailed here . 这个问题似乎是Rails和Sprockets之间不兼容的原因,在进行了详细介绍。 I guess this problem will be resolved when the final version of Rails 3.1 arrives. 我想这个问题将在Rails 3.1的最终版本到来时解决。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM