【发布时间】:2012-01-16 03:02:08
【问题描述】:
经过审核,这个问题被问了many、many、many 次。但是我仍然不明白为什么rake assets:precompile 会失败。
我可以使用本地服务器(例如瘦)从我的浏览器查看以下结果:
body{
@include background-image(image-url('my_image.png'));
background-repeat: repeat;
...
...
}
(注意:图像路径似乎根本不起作用,我正在使用 thinkbot bourbon 作为 SCSS 库)
然而,每次我运行预编译时,我都会得到以下信息(短跟踪):
rake aborted!
images/my_image.png isn't precompiled
(in /path/to/myapp/app/assets/stylesheets/application.css.scss)
Tasks: TOP => assets:precompile
(See full trace by running task with --trace)
这个post 建议我更改我的production.rb 文件,我这样做了,它编译了我的图像并且rake 现在抱怨我有一个未定义的mixin 'border-radius'。也许这是下一个例外,但我不太确定。一切都在本地运行。
Rails Guides (3.1.3) 明确声明将该值设置为 true
'uses more memory, performs poorer than the default and is not recommended'
所以现在我有两个问题。性能降级,我的 SCSS 库现在有未定义的 mixin。
我想解决由rake assets:precompile 引起的生产部署问题。我的 Gemfile 资产组如下所示:
group :assets do
gem 'sass-rails', " ~> 3.1.0"
gem 'coffee-rails', "~> 3.1.0"
gem 'uglifier'
gem 'zurb-foundation'
gem 'bourbon'
end
【问题讨论】:
-
您找到解决方案了吗?我不明白为什么它在生产中找不到波旁威士忌。
-
我没有。我升级到 3.2.x,它使用最新的波旁宝石。
标签: ruby-on-rails-3.1 rake sass asset-pipeline