Question

I'm a rails noob and i have a rails production application on Heroku. In order to have more prudent predeployment evaluation I set up a staging version using the usual:

$ heroku create --remote staging
$ git push staging master
$ heroku run rake db:migrate --remote staging
$ heroku open --remote staging

and when i launch the staging app it looks fine except all the css/scss is not running.

what i am overlooking??

Here is my environment.rb file:

# Load the rails application
require File.expand_path('../application', __FILE__)

# Initialize the rails application
Usrochr::Application.initialize!

and here is my production.rb file [my staging.rb is the same]:

Usrochr::Application.configure do

config.cache_classes = true

config.consider_all_requests_local       = false
config.action_controller.perform_caching = true

config.serve_static_assets = false
config.assets.compress = true
config.assets.compile = false

config.assets.digest = true
config.i18n.fallbacks = true
config.active_support.deprecation = :notify

end
Was it helpful?

Solution

check your production.rb that ............config.serve_static_assets = true also By default assets:precompile won't process the css/js files in /vendor/assets. In production.rb you can use config.assets.precompile to get additional css/js files processed by the asset precompileconfig.assets.precompile += %w[ bootstrap/*.css bootstrap/*.js ] Then rake assets:precompile will process them and they'll work on heroku

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top