Heroku assets problem.

325 views
Skip to first unread message

Sergei Muzukin

unread,
May 25, 2014, 6:35:47 AM5/25/14
to communi...@googlegroups.com
Hello guys. I created simple project and added CE using rails 4. Locally everything worked properly, but when I pushed code to heroku community_engine.css, community_engine.js files didn't worked. It not first time that I pushed something to heroku. In gemfile I added gem 'pg', 'thin', 'rails_12factor'. And in config/application.rb "config.serve_static_assets = true". And still get this error: 
"Failed to load resource: the server responded with a status of 404 (NotFound)http://tagsocial.herokuapp.com/stylesheets/community_engine.css, js"

Please help, if someone have idea.
Thanks!

Bruno Bornsztein

unread,
May 25, 2014, 8:10:30 AM5/25/14
to communi...@googlegroups.com
You need to add communityengine.js/css to your precompiled assets (in production.rb), or require it from your application.js/css. 


--
You received this message because you are subscribed to the Google Groups "CommunityEngine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to communityengi...@googlegroups.com.
To post to this group, send email to communi...@googlegroups.com.
Visit this group at http://groups.google.com/group/communityengine.
For more options, visit https://groups.google.com/d/optout.

Sergei Muzukin

unread,
May 25, 2014, 8:59:27 AM5/25/14
to communi...@googlegroups.com
I did that by adding this line: "config.assets.precompile += %w( community_engine.css, community_engine.js  ) ". 
Didn't help.  Maybe something else?

Bruno Bornsztein

unread,
May 25, 2014, 9:43:29 AM5/25/14
to communi...@googlegroups.com
Is your asset precompilation step completing succesfully when you deply? Can you share your production.rb?


On Sun, May 25, 2014 at 7:59 AM, Sergei Muzukin <muzy...@gmail.com> wrote:
I did that by adding this line: "config.assets.precompile += %w( community_engine.css, community_engine.js  ) ". 
Didn't help.  Maybe something else?

Sergei Muzukin

unread,
May 25, 2014, 10:46:07 AM5/25/14
to communi...@googlegroups.com
Yes it works. 
Here it is config/environment/production: 
Myapp::Application.configure do
  config.cache_classes = true
  config.eager_load = true

  config.consider_all_requests_local       = false
  config.action_controller.perform_caching = true
  config.assets.js_compressor = :uglifier
  config.assets.compile = false
  config.assets.digest = true
  config.assets.version = '1.0'
  config.log_level = :info

  # Enable serving of images, stylesheets, and JavaScripts from an asset server.
  # config.action_controller.asset_host = "http://assets.example.com"

  # Precompile additional assets.
  # application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
  config.assets.precompile += %w( community_engine.css, community_engine.js  )

  config.i18n.fallbacks = true
  config.active_support.deprecation = :notify
  config.log_formatter = ::Logger::Formatter.new
end

Joshua

unread,
May 25, 2014, 10:20:59 PM5/25/14
to communi...@googlegroups.com
try to run `RAILS_ENV=production rake assets:precompile` then push it to heroku again?


--
Reply all
Reply to author
Forward
0 new messages