Search code examples
ruby-on-railsember-cli

No images and fonts production capistrano, rails , ember cli gem?


I am trying to deploy an app which uses ember-cli-rails by capistrano. Everything works fine but there is no images and fonts in production. I put my styles in app.scss and use url('some.images') as a helper. I have tried both way to precompile my assets locally then deploy it and not to precompile assets and let the capistrano does it. None of the ways worked. There is no images and fonts. I have tried some other helper like image-path, image_path , image-url , image_url so on, but none of them helped. Tried to configure rails itself by putting config.serve.static.assets = true in production.rb even though I do not think it is neccessary, but still no luck. When I inspected the page in production it says can not load the image. It seems there is something wrong with the helper (url('some.images')) I use?? I followed almost all related posted to this problem in stackoverflow but none of them worked. I do not know what I am missing here?

app.scss:

body {
  background: url('bg.png');
  font-weight: 400;
} 

production.rb:

config.assets.js_compressor = :uglifier
config.assets.compile = false
config.assets.digest = true
config.serve_static_files = ENV['RAILS_SERVE_STATIC_FILES'].present?

Capfile and deploy.rb are just normal one which can be used by capistrano.
Rails vesion is 4.2 and Ember version is 0.2.7 .
Any help would be appreciated.


Solution

  • Turned out that by changing config.assets.compile = false to true.it works.