0
votes

My Rails app is not loading assets correctly in the staging environment, even after I run rake assets:precompile RAILS_ENV="staging".

This is my staging config:

  config.serve_static_files = ENV['RAILS_SERVE_STATIC_FILES'].present?

  config.assets.js_compressor = :uglifier

  config.assets.compile = false

  # Generate digests for assets URLs
  config.assets.digest = true

  # config.force_ssl = true

  # Expands the lines which load the assets
  # config.assets.debug = false

  config.log_level = :debug

Here's a screenshot of my browser's development console.

The path is wrong... does someone know whyyy???

3
why did you set config.assets.compile = false?Rodrigo
Are you using this host (192.168.0.71) as your staging URL? If not, do you have access to this host from your machine?Rodrigo Castro

3 Answers

0
votes

you tried to set up config.assets.compile variable to false? In most of cases this is the main problem! I expect help.

0
votes

I found the problem. After migrate the Rails 3 to 4 i forgot put this config in initializers/assets.rb

Rails.application.config.assets.precompile += %w( some.js some.css )

Thank you guys!

-1
votes

Configure config.action_controller.asset_host