0

When I run the app I deployed to Heroku, I get this error:

ActionView::Template::Error ('fontawesome.less' wasn't found

I've tried precompile the assets locally - this way:

bundle exec rake assets:precompile

The result:

...
FATAL:  database "myapp_production" does not exist
...

When I run - heroku run rake assets:precompile, the result is:

...
'fontawesome.less' wasn't found
...

The setup in config/environments/production.rb:

  config.assets.compile = true

What causes this problem?

Many thanks

4

2 回答 2

0

你需要有 less-rails gem 并且文件的后缀是 .css.less

宝石“少导轨”

如果需要将文件与application.js分开,则需要在environments/production.rb中添加预编译数组,文件扩展名应为“.css.less”

config.assets.precompile += %w( fontawesome.css )

并确保您在环境/production.rb 中启用了 static_assets 选项

config.serve_static_assets = true

于 2013-10-27T01:40:18.510 回答
0

您应该解决数据库配置问题,以便能够在本地编译资产。

编译的资产将全部是.css,不是less

检查config/application.rb,例如,我在那里有这些行:

config.assets.paths << Rails.root.join("app", "assets", "flash")
config.assets.precompile += [ 'print.css', 'resume.css', 'application.css', 'reset-min.css', 'lightbox.css', 'bootstrap.css', 'grid.css' ]
config.assets.precompile += [ 'rails.js', 'application.js', 'bootstrap.js' ]
config.assets.enabled = true
config.assets.version = '1.0'
于 2013-10-27T00:45:39.027 回答