I'm new to rails and heroku and was hoping someone could help me out with an issue I'm having. I have a cedar stack. I added config.assets.initialize_on_precompile = false to my application.rb file when I push it does 'Running: rake assets:precompile. I don't see any mention of my jquery-ui-1.8.18custom.css file specifically however. When I run heroku logs it complains this file is not precompiled. Am I missing something? When I try to precompile locally it just hangs, but its my understanding I shouldn't have to do it locally anyway and its best not to.
Any suggestions?
Here's the end of my push on heroku:
Running: rake assets:precompile
/usr/local/bin/ruby /tmp/build_3gao4dm3wwned/vendor/bundle/ruby/1.9.1/bin
/rake assets:precompile:nondigest RAILS_ENV=production RAILS_GROUPS=assets
-----> Rails plugin injection
Injecting rails_log_stdout
Injecting rails3_serve_static_assets
-----> Discovering process types
Procfile declares types -> (none)
Default types for Ruby/Rails -> console, rake, web, worker
-----> Compiled slug size is 16.2MB
-----> Launching... done, v82
http://MYAPPNAME.herokuapp.com deployed to Heroku
Here's my error log:
2012-03-14T15:40:29+00:00 app[web.1]: Completed 500 Internal Server Error in 2ms
2012-03-14T15:40:29+00:00 app[web.1]: Rendered homes/index.html.erb within layou
ts/application (0.4ms)
2012-03-14T15:40:29+00:00 app[web.1]: 2: <html>
2012-03-14T15:40:29+00:00 app[web.1]:
2012-03-14T15:40:29+00:00 app[web.1]: ActionView::Template::Error (jquery-ui-1.8
.18.custom isn't precompiled):
UPDATE:
I added config.assets.compile = true to production.rb and that seems to have solved the problem. Are there any issues with this?
As an alternative I had tried adding this to application.rb instead: onfig.assets.precompile += %w( *.js *.css ) and then running rake precompile and I was still getting the error.
This could be two things. If you're trying to link direct to the asset from your views then you need to set it to pre-compile:
http://neilmiddleton.com/precompiling-non-default-assets-with-rails-3/
If, however, it's just in the tree and you're expecting it to be included with application.css
then you need to ensure that it's either in the manifest directly, or in one of the included trees if there are any listed.
for instance (application.css
):
/*
* This is a manifest file that'll automatically include all the stylesheets available in this directory
* and any sub-directories. You're free to add application-wide styles to this file and they'll appear at
* the top of the compiled file, but it's generally better to create a new file per style scope.
*= require_self
*= require "reset"
*= require "base"
*= require "jquery-ui-1.8.18.custom"
*/