1

For my project I'm using rails_admin and try to use rich text formatting gem. Locally everything works fine, but it won't work in production on heroku. I get the error

ActionView::Template::Error (rich/editor.css isn't precompiled)

This is how I precompile:

config.assets.precompile << *.js

And I also tried this:

config.assets.precompile += %w( *.css *.js )

UPDATE:

I'm precompiling the assets locally before deploying to heroku by running this command:

RAILS_ENV=production bundle exec rake assets:precompile

and i have this in my application.css

*= require_self
*= require rich/editor
*= require_tree .

Anyone who can help me on this?

4

1 回答 1

0

听起来像是资产管道的问题。

您可以通过两种方式在 Heroku 上使用资产管道。

  1. 在本地编译资产。
  2. 在 slug 编译期间编译资产。

这里有关于这两种方法的完整文档。

https://devcenter.heroku.com/articles/rails-asset-pipeline

更新:

你试过添加吗?

config.assets.precompile << 'rich/editor.css' 

到你的application.rb?

顺便说一句,如果您不知道:为了节省您每次推送到 Heroku 进行测试的时间,您应该检查 editor.css 的内容是否在生成的 public/assets/application.css 文件中。

于 2013-10-31T12:14:58.767 回答