Ruby on Rails Rake assets:precompile error - ruby-on-rails

I'm new in Rails development and this is my first deployment to Heroku.
When I execute my application (after the deployment) there is an error:
2011-09-18T21:05:54+00:00 app[web.1]: Completed 500 Internal Server Error in 10ms
2011-09-18T21:05:54+00:00 app[web.1]:
2011-09-18T21:05:54+00:00 app[web.1]: ActionView::Template::Error (application.css isn't precompiled):
I googled this and found that I have to precompile my assets, but when trying to do this I found an other error:
$ bundle exec rake assets:precompile RAILS_ENV=production
rake aborted!
No such process - /usr/lib/ruby/gems/1.8/gems/pg-0.11.0/lib/pg_ext.so
(See full trace by running task with --trace)
I haven't found any solution for this issue. Is there anyone who faced this an know how to solve this problem?

I ran into this issue as well and I resolved it by doing the following:
Open up config/environments/production.rb and make sure the following option is set to true:
# Don't fallback to assets pipeline if a precompiled asset is missed
config.assets.compile = true
Then run:
rake assets:precompile --trace RAILS_ENV=production
Hope this helps!
~Kevin

I got the problem too. But you can
rake assets:precompile RAILS_ENV=production
in local, and push to heroku with public/assets. It's resolved.

I would recommend to use the new Cedar stack. It precompiles assets for you on deploy and overall plays nicer with Rails 3.1, although you will need to configure your app a little bit to work: add some gems to your Gemfile and create a Procfile. But it is still an easier way to go.

Oh, this is an easy one. Your PG gem is breaking your rake task. You can either go the long route to try to fix it, or you can try commenting it out from your gemfile in order to run the precompile.

Yes like Simpleton posted above the PG gem is causing the problem. Imo a better solution would be to move the PG gem inside production in your gemfile and run;
bundle install --without production
Then you should be able to run the rake task without problems

I had the same error message. My issue was an incorrectly specified font url.
The bulk of this answer shows how I figured it out.
Although I didn't get the path of the asset it was failing on when running
RAILS_ENV=production SECRET_KEY_BASE=xxx rake assets:precompile --trace
Instead I had this stack trace:
** Invoke assets:precompile (first_time)
** Invoke assets:environment (first_time)
** Execute assets:environment
** Invoke environment (first_time)
** Execute environment
** Execute assets:precompile
rake aborted!
NoMethodError: undefined method `[]' for nil:NilClass
/Users/smithd98/.rvm/gems/ruby-2.3.1/gems/sprockets-3.7.0/lib/sprockets/sass_processor.rb:283:in `sprockets_context'
/Users/smithd98/.rvm/gems/ruby-2.3.1/gems/sprockets-3.7.0/lib/sprockets/sass_processor.rb:124:in `asset_path'
/Users/smithd98/.rvm/gems/ruby-2.3.1/gems/sprockets-3.7.0/lib/sprockets/sass_processor.rb:142:in `asset_url'
/Users/smithd98/.rvm/gems/ruby-2.3.1/gems/sprockets-3.7.0/lib/sprockets/sass_processor.rb:214:in `font_url'
/Users/smithd98/.rvm/gems/ruby-2.3.1/gems/sass-3.4.22/lib/sass/script/tree/funcall.rb:143:in `_perform'
/Users/smithd98/.rvm/gems/ruby-2.3.1/gems/sass-3.4.22/lib/sass/script/tree/node.rb:58:in `perform'
/Users/smithd98/.rvm/gems/ruby-2.3.1/gems/sass-3.4.22/lib/sass/script/tree/list_literal.rb:63:in `block in _perform'
/Users/smithd98/.rvm/gems/ruby-2.3.1/gems/sass-3.4.22/lib/sass/script/tree/list_literal.rb:63:in `map'
/Users/smithd98/.rvm/gems/ruby-2.3.1/gems/sass-3.4.22/lib/sass/script/tree/list_literal.rb:63:in `_perform'
/Users/smithd98/.rvm/gems/ruby-2.3.1/gems/sass-3.4.22/lib/sass/script/tree/node.rb:58:in `perform'
/Users/smithd98/.rvm/gems/ruby-2.3.1/gems/sass-3.4.22/lib/sass/tree/visitors/perform.rb:397:in `visit_prop'
/Users/smithd98/.rvm/gems/ruby-2.3.1/gems/sass-3.4.22/lib/sass/tree/visitors/base.rb:36:in `visit'
/Users/smithd98/.rvm/gems/ruby-2.3.1/gems/sass-3.4.22/lib/sass/tree/visitors/perform.rb:160:in `block in visit'
/Users/smithd98/.rvm/gems/ruby-2.3.1/gems/sass-3.4.22/lib/sass/stack.rb:79:in `block in with_base'
/Users/smithd98/.rvm/gems/ruby-2.3.1/gems/sass-3.4.22/lib/sass/stack.rb:115:in `with_frame'
/Users/smithd98/.rvm/gems/ruby-2.3.1/gems/sass-3.4.22/lib/sass/stack.rb:79:in `with_base'
/Users/smithd98/.rvm/gems/ruby-2.3.1/gems/sass-3.4.22/lib/sass/tree/visitors/perform.rb:160:in `visit'
/Users/smithd98/.rvm/gems/ruby-2.3.1/gems/sass-3.4.22/lib/sass/tree/visitors/perform.rb:433:in `block (2 levels) in visit_rule'
/Users/smithd98/.rvm/gems/ruby-2.3.1/gems/sass-3.4.22/lib/sass/tree/visitors/perform.rb:433:in `map'
/Users/smithd98/.rvm/gems/ruby-2.3.1/gems/sass-3.4.22/lib/sass/tree/visitors/perform.rb:433:in `block in visit_rule'
/Users/smithd98/.rvm/gems/ruby-2.3.1/gems/sass-3.4.22/lib/sass/tree/visitors/perform.rb:181:in `with_environment'
/Users/smithd98/.rvm/gems/ruby-2.3.1/gems/sass-3.4.22/lib/sass/tree/visitors/perform.rb:431:in `visit_rule'
/Users/smithd98/.rvm/gems/ruby-2.3.1/gems/sass-3.4.22/lib/sass/tree/visitors/base.rb:36:in `visit'
/Users/smithd98/.rvm/gems/ruby-2.3.1/gems/sass-3.4.22/lib/sass/tree/visitors/perform.rb:160:in `block in visit'
/Users/smithd98/.rvm/gems/ruby-2.3.1/gems/sass-3.4.22/lib/sass/stack.rb:79:in `block in with_base'
/Users/smithd98/.rvm/gems/ruby-2.3.1/gems/sass-3.4.22/lib/sass/stack.rb:115:in `with_frame'
/Users/smithd98/.rvm/gems/ruby-2.3.1/gems/sass-3.4.22/lib/sass/stack.rb:79:in `with_base'
/Users/smithd98/.rvm/gems/ruby-2.3.1/gems/sass-3.4.22/lib/sass/tree/visitors/perform.rb:160:in `visit'
/Users/smithd98/.rvm/gems/ruby-2.3.1/gems/sass-3.4.22/lib/sass/tree/visitors/base.rb:52:in `block in visit_children'
/Users/smithd98/.rvm/gems/ruby-2.3.1/gems/sass-3.4.22/lib/sass/tree/visitors/base.rb:52:in `map'
/Users/smithd98/.rvm/gems/ruby-2.3.1/gems/sass-3.4.22/lib/sass/tree/visitors/base.rb:52:in `visit_children'
/Users/smithd98/.rvm/gems/ruby-2.3.1/gems/sass-3.4.22/lib/sass/tree/visitors/perform.rb:169:in `block in visit_children'
/Users/smithd98/.rvm/gems/ruby-2.3.1/gems/sass-3.4.22/lib/sass/tree/visitors/perform.rb:181:in `with_environment'
/Users/smithd98/.rvm/gems/ruby-2.3.1/gems/sass-3.4.22/lib/sass/tree/visitors/perform.rb:168:in `visit_children'
/Users/smithd98/.rvm/gems/ruby-2.3.1/gems/sass-3.4.22/lib/sass/tree/visitors/base.rb:36:in `block in visit'
/Users/smithd98/.rvm/gems/ruby-2.3.1/gems/sass-3.4.22/lib/sass/tree/visitors/perform.rb:188:in `visit_root'
/Users/smithd98/.rvm/gems/ruby-2.3.1/gems/sass-3.4.22/lib/sass/tree/visitors/base.rb:36:in `visit'
/Users/smithd98/.rvm/gems/ruby-2.3.1/gems/sass-3.4.22/lib/sass/tree/visitors/perform.rb:159:in `visit'
/Users/smithd98/.rvm/gems/ruby-2.3.1/gems/sass-3.4.22/lib/sass/tree/visitors/perform.rb:8:in `visit'
/Users/smithd98/.rvm/gems/ruby-2.3.1/gems/sass-3.4.22/lib/sass/tree/root_node.rb:36:in `css_tree'
/Users/smithd98/.rvm/gems/ruby-2.3.1/gems/sass-3.4.22/lib/sass/tree/root_node.rb:20:in `render'
/Users/smithd98/.rvm/gems/ruby-2.3.1/gems/sass-3.4.22/lib/sass/engine.rb:281:in `render'
/Users/smithd98/.rvm/gems/ruby-2.3.1/gems/sprockets-3.7.0/lib/sprockets/sass_compressor.rb:48:in `call'
/Users/smithd98/.rvm/gems/ruby-2.3.1/gems/sprockets-3.7.0/lib/sprockets/sass_compressor.rb:28:in `call'
/Users/smithd98/.rvm/gems/ruby-2.3.1/gems/sprockets-3.7.0/lib/sprockets/processor_utils.rb:75:in `call_processor'
/Users/smithd98/.rvm/gems/ruby-2.3.1/gems/sprockets-3.7.0/lib/sprockets/processor_utils.rb:57:in `block in call_processors'
/Users/smithd98/.rvm/gems/ruby-2.3.1/gems/sprockets-3.7.0/lib/sprockets/processor_utils.rb:56:in `reverse_each'
/Users/smithd98/.rvm/gems/ruby-2.3.1/gems/sprockets-3.7.0/lib/sprockets/processor_utils.rb:56:in `call_processors'
/Users/smithd98/.rvm/gems/ruby-2.3.1/gems/sprockets-3.7.0/lib/sprockets/loader.rb:134:in `load_from_unloaded'
/Users/smithd98/.rvm/gems/ruby-2.3.1/gems/sprockets-3.7.0/lib/sprockets/loader.rb:60:in `block in load'
/Users/smithd98/.rvm/gems/ruby-2.3.1/gems/sprockets-3.7.0/lib/sprockets/loader.rb:317:in `fetch_asset_from_dependency_cache'
/Users/smithd98/.rvm/gems/ruby-2.3.1/gems/sprockets-3.7.0/lib/sprockets/loader.rb:44:in `load'
/Users/smithd98/.rvm/gems/ruby-2.3.1/gems/sprockets-3.7.0/lib/sprockets/cached_environment.rb:20:in `block in initialize'
/Users/smithd98/.rvm/gems/ruby-2.3.1/gems/sprockets-3.7.0/lib/sprockets/cached_environment.rb:47:in `load'
/Users/smithd98/.rvm/gems/ruby-2.3.1/gems/sprockets-3.7.0/lib/sprockets/base.rb:66:in `find_asset'
/Users/smithd98/.rvm/gems/ruby-2.3.1/gems/sprockets-3.7.0/lib/sprockets/base.rb:73:in `find_all_linked_assets'
/Users/smithd98/.rvm/gems/ruby-2.3.1/gems/sprockets-3.7.0/lib/sprockets/manifest.rb:142:in `block in find'
/Users/smithd98/.rvm/gems/ruby-2.3.1/gems/sprockets-3.7.0/lib/sprockets/legacy.rb:114:in `block (2 levels) in logical_paths'
/Users/smithd98/.rvm/gems/ruby-2.3.1/gems/sprockets-3.7.0/lib/sprockets/path_utils.rb:228:in `block in stat_tree'
/Users/smithd98/.rvm/gems/ruby-2.3.1/gems/sprockets-3.7.0/lib/sprockets/path_utils.rb:212:in `block in stat_directory'
/Users/smithd98/.rvm/gems/ruby-2.3.1/gems/sprockets-3.7.0/lib/sprockets/path_utils.rb:209:in `each'
/Users/smithd98/.rvm/gems/ruby-2.3.1/gems/sprockets-3.7.0/lib/sprockets/path_utils.rb:209:in `stat_directory'
/Users/smithd98/.rvm/gems/ruby-2.3.1/gems/sprockets-3.7.0/lib/sprockets/path_utils.rb:227:in `stat_tree'
/Users/smithd98/.rvm/gems/ruby-2.3.1/gems/sprockets-3.7.0/lib/sprockets/legacy.rb:105:in `each'
/Users/smithd98/.rvm/gems/ruby-2.3.1/gems/sprockets-3.7.0/lib/sprockets/legacy.rb:105:in `block in logical_paths'
/Users/smithd98/.rvm/gems/ruby-2.3.1/gems/sprockets-3.7.0/lib/sprockets/legacy.rb:104:in `each'
/Users/smithd98/.rvm/gems/ruby-2.3.1/gems/sprockets-3.7.0/lib/sprockets/legacy.rb:104:in `logical_paths'
/Users/smithd98/.rvm/gems/ruby-2.3.1/gems/sprockets-3.7.0/lib/sprockets/manifest.rb:140:in `find'
/Users/smithd98/.rvm/gems/ruby-2.3.1/gems/sprockets-3.7.0/lib/sprockets/manifest.rb:185:in `compile'
/Users/smithd98/.rvm/gems/ruby-2.3.1/gems/sprockets-rails-3.1.1/lib/sprockets/rails/task.rb:68:in `block (3 levels) in define'
/Users/smithd98/.rvm/gems/ruby-2.3.1/gems/sprockets-3.7.0/lib/rake/sprocketstask.rb:147:in `with_logger'
/Users/smithd98/.rvm/gems/ruby-2.3.1/gems/sprockets-rails-3.1.1/lib/sprockets/rails/task.rb:67:in `block (2 levels) in define'
/Users/smithd98/.rvm/gems/ruby-2.3.1/gems/rake-11.2.2/lib/rake/task.rb:248:in `block in execute'
/Users/smithd98/.rvm/gems/ruby-2.3.1/gems/rake-11.2.2/lib/rake/task.rb:243:in `each'
/Users/smithd98/.rvm/gems/ruby-2.3.1/gems/rake-11.2.2/lib/rake/task.rb:243:in `execute'
/Users/smithd98/.rvm/gems/ruby-2.3.1/gems/rake-11.2.2/lib/rake/task.rb:187:in `block in invoke_with_call_chain'
/Users/smithd98/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/monitor.rb:214:in `mon_synchronize'
/Users/smithd98/.rvm/gems/ruby-2.3.1/gems/rake-11.2.2/lib/rake/task.rb:180:in `invoke_with_call_chain'
/Users/smithd98/.rvm/gems/ruby-2.3.1/gems/rake-11.2.2/lib/rake/task.rb:173:in `invoke'
/Users/smithd98/.rvm/gems/ruby-2.3.1/gems/rake-11.2.2/lib/rake/application.rb:152:in `invoke_task'
/Users/smithd98/.rvm/gems/ruby-2.3.1/gems/rake-11.2.2/lib/rake/application.rb:108:in `block (2 levels) in top_level'
/Users/smithd98/.rvm/gems/ruby-2.3.1/gems/rake-11.2.2/lib/rake/application.rb:108:in `each'
/Users/smithd98/.rvm/gems/ruby-2.3.1/gems/rake-11.2.2/lib/rake/application.rb:108:in `block in top_level'
/Users/smithd98/.rvm/gems/ruby-2.3.1/gems/rake-11.2.2/lib/rake/application.rb:117:in `run_with_threads'
/Users/smithd98/.rvm/gems/ruby-2.3.1/gems/rake-11.2.2/lib/rake/application.rb:102:in `top_level'
/Users/smithd98/.rvm/gems/ruby-2.3.1/gems/rake-11.2.2/lib/rake/application.rb:80:in `block in run'
/Users/smithd98/.rvm/gems/ruby-2.3.1/gems/rake-11.2.2/lib/rake/application.rb:178:in `standard_exception_handling'
/Users/smithd98/.rvm/gems/ruby-2.3.1/gems/rake-11.2.2/lib/rake/application.rb:77:in `run'
/Users/smithd98/.rvm/gems/ruby-2.3.1/gems/rake-11.2.2/exe/rake:27:in `<top (required)>'
/Users/smithd98/.rvm/gems/ruby-2.3.1/bin/rake:23:in `load'
/Users/smithd98/.rvm/gems/ruby-2.3.1/bin/rake:23:in `<main>'
/Users/smithd98/.rvm/gems/ruby-2.3.1/bin/ruby_executable_hooks:15:in `eval'
/Users/smithd98/.rvm/gems/ruby-2.3.1/bin/ruby_executable_hooks:15:in `<main>'
I modified the gem to spit out the filename
subl /Users/smithd98/.rvm/gems/ruby-2.3.1/gems/sprockets-3.7.0/lib/sprockets/sass_processor.rb:124:in
like this
def asset_path(path, options = {})
path = path.value
puts path
puts '123'
path, _, query, fragment = URI.split(path)[5..8]
puts '126'
path = sprockets_context.asset_path(path, options)
puts '128'
query = "?#{query}" if query
puts '130'
fragment = "##{fragment}" if fragment
puts '132'
Autoload::Sass::Script::String.new("#{path}#{query}#{fragment}", :string)
end
Then when I ran
RAILS_ENV=production SECRET_KEY_BASE=xxx rake assets:precompile --trace
I got
** Invoke assets:precompile (first_time)
** Invoke assets:environment (first_time)
** Execute assets:environment
** Invoke environment (first_time)
** Execute environment
** Execute assets:precompile
fonts/OpenSans-Light.ttf
123
126
rake aborted!
NoMethodError: undefined method `[]' for nil:NilClass
/Users/smithd98/.rvm/gems/ruby-2.3.1/gems/sprockets-3.7.0/lib/sprockets/sass_processor.rb:283:in `sprockets_context'
...the rest of the stack trace is the same...
Then I found out the issue was a font had been specified like this:
.btn-rect {
font-family: 'OpenSans-Light';
src:font-url('fonts/OpenSans-Light.ttf') format('truetype');
}
and should have been like this:
.btn-rect {
font-family: 'OpenSans-Light';
}

Instead of config.assets.compile = true use config.serve_static_assets = true
The first option is incorrect, because it tells your server to go back to serving the app/assets folder.

Related

Assets Precompile When Explicitly Invoked, Breaks During Capistrano Deployment

I am using Rails 4.2, and Capistrano 3. When I run bundle exec rake assets:precompile, everything works out nice and dandy, however when I use Capistrano to deploy the site, I get this error during the asset:precompile step.
Tasks: TOP => deploy:assets:precompile
(See full trace by running task with --trace)
The deploy has failed with an error: Exception while executing as xxx#123.45.67.89: rake exit status: 1
rake stdout: rake aborted!
Sass::SyntaxError: Invalid CSS after " */": expected "}", was ""
(sass):6831
/home/xxx/Sites/my-app/shared/bundle/ruby/2.2.0/gems/sass-3.4.19/lib/sass/scss/parser.rb:1161:in `expected'
/home/xxx/Sites/my-app/shared/bundle/ruby/2.2.0/gems/sass-3.4.19/lib/sass/scss/parser.rb:1097:in `expected'
/home/xxx/Sites/my-app/shared/bundle/ruby/2.2.0/gems/sass-3.4.19/lib/sass/scss/parser.rb:1092:in `tok!'
/home/xxx/Sites/my-app/shared/bundle/ruby/2.2.0/gems/sass-3.4.19/lib/sass/scss/parser.rb:639:in `block'
/home/xxx/Sites/my-app/shared/bundle/ruby/2.2.0/gems/sass-3.4.19/lib/sass/scss/parser.rb:631:in `ruleset'
/home/xxx/Sites/my-app/shared/bundle/ruby/2.2.0/gems/sass-3.4.19/lib/sass/scss/parser.rb:656:in `block_child'
/home/xxx/Sites/my-app/shared/bundle/ruby/2.2.0/gems/sass-3.4.19/lib/sass/scss/parser.rb:649:in `block_contents'
/home/xxx/Sites/my-app/shared/bundle/ruby/2.2.0/gems/sass-3.4.19/lib/sass/scss/parser.rb:117:in `stylesheet'
/home/xxx/Sites/my-app/shared/bundle/ruby/2.2.0/gems/sass-3.4.19/lib/sass/scss/parser.rb:42:in `parse'
/home/xxx/Sites/my-app/shared/bundle/ruby/2.2.0/gems/sass-3.4.19/lib/sass/engine.rb:403:in `_to_tree'
/home/xxx/Sites/my-app/shared/bundle/ruby/2.2.0/gems/sass-3.4.19/lib/sass/engine.rb:278:in `render'
/home/xxx/Sites/my-app/shared/bundle/ruby/2.2.0/gems/sprockets-3.5.0/lib/sprockets/sass_compressor.rb:48:in `call'
/home/xxx/Sites/my-app/shared/bundle/ruby/2.2.0/gems/sprockets-3.5.0/lib/sprockets/sass_compressor.rb:28:in `call'
/home/xxx/Sites/my-app/shared/bundle/ruby/2.2.0/gems/sprockets-3.5.0/lib/sprockets/processor_utils.rb:75:in `call_processor'
/home/xxx/Sites/my-app/shared/bundle/ruby/2.2.0/gems/sprockets-3.5.0/lib/sprockets/processor_utils.rb:57:in `block in call_processors'
/home/xxx/Sites/my-app/shared/bundle/ruby/2.2.0/gems/sprockets-3.5.0/lib/sprockets/processor_utils.rb:56:in `reverse_each'
/home/xxx/Sites/my-app/shared/bundle/ruby/2.2.0/gems/sprockets-3.5.0/lib/sprockets/processor_utils.rb:56:in `call_processors'
/home/xxx/Sites/my-app/shared/bundle/ruby/2.2.0/gems/sprockets-3.5.0/lib/sprockets/loader.rb:134:in `load_from_unloaded'
/home/xxx/Sites/my-app/shared/bundle/ruby/2.2.0/gems/sprockets-3.5.0/lib/sprockets/loader.rb:60:in `block in load'
/home/xxx/Sites/my-app/shared/bundle/ruby/2.2.0/gems/sprockets-3.5.0/lib/sprockets/loader.rb:318:in `fetch_asset_from_dependency_cache'
/home/xxx/Sites/my-app/shared/bundle/ruby/2.2.0/gems/sprockets-3.5.0/lib/sprockets/loader.rb:44:in `load'
/home/xxx/Sites/my-app/shared/bundle/ruby/2.2.0/gems/sprockets-3.5.0/lib/sprockets/cached_environment.rb:20:in `block in initialize'
/home/xxx/Sites/my-app/shared/bundle/ruby/2.2.0/gems/sprockets-3.5.0/lib/sprockets/cached_environment.rb:47:in `yield'
/home/xxx/Sites/my-app/shared/bundle/ruby/2.2.0/gems/sprockets-3.5.0/lib/sprockets/cached_environment.rb:47:in `load'
/home/xxx/Sites/my-app/shared/bundle/ruby/2.2.0/gems/sprockets-3.5.0/lib/sprockets/base.rb:66:in `find_asset'
/home/xxx/Sites/my-app/shared/bundle/ruby/2.2.0/gems/sprockets-3.5.0/lib/sprockets/base.rb:73:in `find_all_linked_assets'
/home/xxx/Sites/my-app/shared/bundle/ruby/2.2.0/gems/sprockets-3.5.0/lib/sprockets/manifest.rb:142:in `block in find'
/home/xxx/Sites/my-app/shared/bundle/ruby/2.2.0/gems/sprockets-3.5.0/lib/sprockets/legacy.rb:114:in `block (2 levels) in logical_paths'
/home/xxx/Sites/my-app/shared/bundle/ruby/2.2.0/gems/sprockets-3.5.0/lib/sprockets/path_utils.rb:225:in `block in stat_tree'
/home/xxx/Sites/my-app/shared/bundle/ruby/2.2.0/gems/sprockets-3.5.0/lib/sprockets/path_utils.rb:209:in `block in stat_directory'
/home/xxx/Sites/my-app/shared/bundle/ruby/2.2.0/gems/sprockets-3.5.0/lib/sprockets/path_utils.rb:206:in `each'
/home/xxx/Sites/my-app/shared/bundle/ruby/2.2.0/gems/sprockets-3.5.0/lib/sprockets/path_utils.rb:206:in `stat_directory'
/home/xxx/Sites/my-app/shared/bundle/ruby/2.2.0/gems/sprockets-3.5.0/lib/sprockets/path_utils.rb:224:in `stat_tree'
/home/xxx/Sites/my-app/shared/bundle/ruby/2.2.0/gems/sprockets-3.5.0/lib/sprockets/legacy.rb:105:in `each'
/home/xxx/Sites/my-app/shared/bundle/ruby/2.2.0/gems/sprockets-3.5.0/lib/sprockets/legacy.rb:105:in `block in logical_paths'
/home/xxx/Sites/my-app/shared/bundle/ruby/2.2.0/gems/sprockets-3.5.0/lib/sprockets/legacy.rb:104:in `each'
/home/xxx/Sites/my-app/shared/bundle/ruby/2.2.0/gems/sprockets-3.5.0/lib/sprockets/legacy.rb:104:in `logical_paths'
/home/xxx/Sites/my-app/shared/bundle/ruby/2.2.0/gems/sprockets-3.5.0/lib/sprockets/manifest.rb:140:in `find'
/home/xxx/Sites/my-app/shared/bundle/ruby/2.2.0/gems/sprockets-3.5.0/lib/sprockets/manifest.rb:168:in `compile'
/home/xxx/Sites/my-app/shared/bundle/ruby/2.2.0/gems/sprockets-rails-2.3.3/lib/sprockets/rails/task.rb:70:in `block (3 levels) in define'
/home/xxx/Sites/my-app/shared/bundle/ruby/2.2.0/gems/sprockets-3.5.0/lib/rake/sprocketstask.rb:147:in `with_logger'
/home/xxx/Sites/my-app/shared/bundle/ruby/2.2.0/gems/sprockets-rails-2.3.3/lib/sprockets/rails/task.rb:69:in `block (2 levels) in define'
Tasks: TOP => assets:precompile
(See full trace by running task with --trace)
rake stderr: Nothing written
I have noticed that if I remove the line *= require styles in my application.css file, it successfully deploys, but obviously that is not the solution I am looking for. My assets/stylesheets file-structure is shown below:
Running the following command compiles assets locally in your dev environment:
rake assets:precompile
During deployment capistrano the following task is being invoked (as you can see on top of your backtrace):
cap env_name deploy:assets:precompile
which on it's part invokes this on remote server:
rake assets:precompile
Asset precompilation in development environment ignores syntax errors.
Try running this command locally to find and fix those errors:
RAILS_ENV=production rake assets:precompile --trace

How to use asset names involving Unicode?

I have a number of audio file names that I need to support which are written in Chinese romanization, for example wǒ shì xuésheng.mp3. There seems to be a problem translating these into asset paths or handling the resulting paths, as
http://localhost:3000/assets/wǒ shì xuésheng.mp3
http://localhost:3000/assets/w%C7%92+sh%C3%AC+xu%C3%A9sheng.mp3
http://localhost:3000/assets/w%C7%92%20sh%C3%AC%20xu%C3%A9sheng.mp3
Don't result in anything. I tried asset_path and Rack encode, but there seems to be no way to access these files that are in my directory structure. In order to eliminate potential error sources, I also tried with a file named ma ma.mp3 in the same directory and that one loads fine, so the problem seems to be with the Unicode characters in the file names.
Funnily enough, File.exists works:
File.exists?(File.join(Rails.root, "/app/assets/audios/", "wǒ shì xuésheng.mp3"))
Also, European diacritics work:
http://localhost:3000/assets/bù.mp3
Just Unicode ones break the system.
I'm using Rails 3.2.11 and Ruby 1.9.3. (EDIT: this issue persists even in Rails 4.0.2)
EDIT: I suspect it's a problem with the asset pipeline because I also cannot do a rake assets:precompile while I have Unicode characters in a filename, it fails with "undefined method directory? for nil:NilClass".
EDIT: this is the trace for rake assets:precompile:
** Invoke assets:precompile (first_time)
** Execute assets:precompile
C:/RailsInstaller/Ruby1.9.3/bin/ruby.exe C:/RailsInstaller/Ruby1.9.3/bin/rake assets:precompile:all RAILS_ENV=produ
ction RAILS_GROUPS=assets --trace
** Invoke assets:precompile:all (first_time)
** Execute assets:precompile:all
** Invoke assets:precompile:primary (first_time)
** Invoke assets:environment (first_time)
** Execute assets:environment
** Invoke environment (first_time)
** Execute environment
** Invoke tmp:cache:clear (first_time)
** Execute tmp:cache:clear
** Execute assets:precompile:primary
rake aborted!
undefined method `directory?' for nil:NilClass
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/sprockets-2.2.2/lib/sprockets/base.rb:189:in `block in each_en
try'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/sprockets-2.2.2/lib/sprockets/base.rb:185:in `each'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/sprockets-2.2.2/lib/sprockets/base.rb:185:in `each_entry'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/sprockets-2.2.2/lib/sprockets/base.rb:204:in `block in each_fi
le'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/sprockets-2.2.2/lib/sprockets/base.rb:203:in `each'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/sprockets-2.2.2/lib/sprockets/base.rb:203:in `each_file'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/sprockets-2.2.2/lib/sprockets/base.rb:217:in `each_logical_pat
h'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/actionpack-3.2.15/lib/sprockets/static_compiler.rb:18:in `comp
ile'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/actionpack-3.2.15/lib/sprockets/assets.rake:56:in `internal_pr
ecompile'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/actionpack-3.2.15/lib/sprockets/assets.rake:70:in `block (3 le
vels) in <top (required)>'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/task.rb:236:in `call'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/task.rb:236:in `block in execute'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/task.rb:231:in `each'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/task.rb:231:in `execute'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/task.rb:175:in `block in invoke_with_call
_chain'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/task.rb:168:in `invoke_with_call_chain'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/task.rb:161:in `invoke'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/actionpack-3.2.15/lib/sprockets/assets.rake:60:in `block (3 le
vels) in <top (required)>'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/task.rb:236:in `call'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/task.rb:236:in `block in execute'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/task.rb:231:in `each'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/task.rb:231:in `execute'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/task.rb:175:in `block in invoke_with_call
_chain'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/task.rb:168:in `invoke_with_call_chain'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/task.rb:161:in `invoke'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/application.rb:149:in `invoke_task'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/application.rb:106:in `block (2 levels) i
n top_level'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/application.rb:106:in `each'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/application.rb:106:in `block in top_level
'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/application.rb:115:in `run_with_threads'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/application.rb:100:in `top_level'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/application.rb:78:in `block in run'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/application.rb:165:in `standard_exception
_handling'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/application.rb:75:in `run'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.1/bin/rake:33:in `<top (required)>'
C:/RailsInstaller/Ruby1.9.3/bin/rake:23:in `load'
C:/RailsInstaller/Ruby1.9.3/bin/rake:23:in `<main>'
Tasks: TOP => assets:precompile:primary
rake aborted!
Command failed with status (1): [C:/RailsInstaller/Ruby1.9.3/bin/ruby.exe C...]
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/file_utils.rb:55:in `block in create_shel
l_runner'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/file_utils.rb:45:in `call'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/file_utils.rb:45:in `sh'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/file_utils_ext.rb:37:in `sh'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/file_utils.rb:82:in `ruby'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/file_utils_ext.rb:37:in `ruby'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/actionpack-3.2.15/lib/sprockets/assets.rake:12:in `ruby_rake_t
ask'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/actionpack-3.2.15/lib/sprockets/assets.rake:21:in `invoke_or_r
eboot_rake_task'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/actionpack-3.2.15/lib/sprockets/assets.rake:29:in `block (2 le
vels) in <top (required)>'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/task.rb:236:in `call'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/task.rb:236:in `block in execute'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/task.rb:231:in `each'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/task.rb:231:in `execute'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/task.rb:175:in `block in invoke_with_call
_chain'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/task.rb:168:in `invoke_with_call_chain'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/task.rb:161:in `invoke'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/application.rb:149:in `invoke_task'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/application.rb:106:in `block (2 levels) i
n top_level'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/application.rb:106:in `each'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/application.rb:106:in `block in top_level
'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/application.rb:115:in `run_with_threads'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/application.rb:100:in `top_level'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/application.rb:78:in `block in run'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/application.rb:165:in `standard_exception
_handling'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/application.rb:75:in `run'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.1/bin/rake:33:in `<top (required)>'
C:/RailsInstaller/Ruby1.9.3/bin/rake:23:in `load'
C:/RailsInstaller/Ruby1.9.3/bin/rake:23:in `<main>'
Tasks: TOP => assets:precompile
There've been a large number of bug fixes in the Rails 3.2.x patch releases that may have addressed this issue. Other posts here have implied that upgrading to 3.2.14 fixes this UTF-8 URL encoding issue.
I recommend upgrading to Rails 3.2.15 (current patch release) to see if this issue is resolved.
This is a problem with different handling of Unicode filenames on Windows, Mac and Linux. I tried running the same code on a friend's Linux computer and the same code runs perfectly there.
Since File.exists? works but the asset-related code doesn't, I believe that the asset-related code has not been written from a platform-independent point of view, while the File utilities have. I'm submitting a bug report.

Ruby on Rails: segmentation fault when running 'rake assets:precompile'

Since two days, I am not able to compile the javascript assets in my ruby on rails project anymore. If I do not run the precompile command, the same fault occurs when ruby is compiling the assets at runtime. The 'rake assets:precompile' command aborts because of a segmentation fault:
bundle exec rake assets:precompile --trace
** Invoke assets:precompile (first_time)
** Execute assets:precompile
/home/Roseboom/.rvm/rubies/ruby-1.9.3-p125/bin/ruby /home/Roseboom/.rvm/gems/ruby-1.9.3-p125/bin/rake assets:precompile:all RAILS_ENV=production RAILS_GROUPS=assets --trace
** Invoke assets:precompile:all (first_time)
** Execute assets:precompile:all
** Invoke assets:precompile:primary (first_time)
** Invoke assets:environment (first_time)
** Execute assets:environment
** Invoke environment (first_time)
** Execute environment
** Invoke tmp:cache:clear (first_time)
** Execute tmp:cache:clear
** Execute assets:precompile:primary
sh: regel 1: 15071 Segmentatiefout node /tmp/execjs20120417-15062-69pd5q.js 2>&1
rake aborted!
["ok","(function() {\n\n\n\n}).call(this);\n"]
(in /home/Roseboom/gitControlled/ror/livescore/app/assets/javascripts/clubs.js.coffee)
/home/Roseboom/.rvm/gems/ruby-1.9.3-p125/gems/execjs-1.3.0/lib/execjs/external_runtime.rb:150:in `exec_runtime'
[.... Remaining stacktrace below this post for the sake of readability ]
Here, 'Segmentatiefout' is Dutch for 'Segmentation fault'.
At first, I thought I messed something up with my project, and I started reverting changes to isolate the 'bad' change. When this did not help, I tried the 'bundle exec rake assets:precompile' in a project that I did not tough for weeks, which got me the same segmentation fault.
Now I tried to locate this "execjs20120417-15062-69pd5q.js" file to just remove it. Even with the help of the unix 'find' command, I could not find that. Maybe this temp file is cleaned even when aborted.
Next thing I tried was to reinstall rake, which did not help me. Although the same fault occured when just running 'rake assets:precompile', I tried reinstalling bundler as well. This did not work out as well.
Next thing was a bit rigorously, I reinstalled ruby and rails on my system. Unfortunately, no change at all. Rails version was 3.2.2, and after this reinstalling it is 3.2.3.
Last thing I tried was to uninstall the gem execjs, and reinstall it, but no help from this as well.
Changing the RAILS_ENV to development does not change anything as well.
When I clear my app/assets/javascripts folder, I can precompile, and I can run my application (like described in Rails assets precompile mysterious error). I expect ruby to use the assets that were compiled succesfully before. However, this means I can never change the contents of app/assets/javascripts, which is undesirable. If I remove all the .js.coffee files that are there, the segmentation fault occurs on the .js file that is left.
The file clubs.js.coffee is autogenerated and never changed by me. It was generated a few weeks ago and never got me problems before 2 days ago. If I remove it, the same fault occurs with just another .coffe or .js file. clubs.js.coffee contains:
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
I am really out of ideas on this. Thanks in advance for your help.
Full stacktrace:
bundle exec rake assets:precompile --trace
** Invoke assets:precompile (first_time)
** Execute assets:precompile
/home/Roseboom/.rvm/rubies/ruby-1.9.3-p125/bin/ruby /home/Roseboom/.rvm/gems/ruby-1.9.3-p125/bin/rake assets:precompile:
all RAILS_ENV=production RAILS_GROUPS=assets --trace
** Invoke assets:precompile:all (first_time)
** Execute assets:precompile:all
** Invoke assets:precompile:primary (first_time)
** Invoke assets:environment (first_time)
** Execute assets:environment
** Invoke environment (first_time)
** Execute environment
** Invoke tmp:cache:clear (first_time)
** Execute tmp:cache:clear
** Execute assets:precompile:primary
sh: regel 1: 15936 Segmentatiefout node /tmp/execjs20120417-15927-1ka3s2r.js 2>&1
rake aborted!
["ok","(function() {\n\n\n\n}).call(this);\n"]
(in /home/Roseboom/gitControlled/ror/livescore/app/assets/javascripts/clubs.js.coffee)
/home/Roseboom/.rvm/gems/ruby-1.9.3-p125/gems/execjs-1.3.0/lib/execjs/external_runtime.rb:150:in `exec_runtime'
/home/Roseboom/.rvm/gems/ruby-1.9.3-p125/gems/execjs-1.3.0/lib/execjs/external_runtime.rb:27:in `block in exec'
/home/Roseboom/.rvm/gems/ruby-1.9.3-p125/gems/execjs-1.3.0/lib/execjs/external_runtime.rb:40:in `compile_to_tempfile'
/home/Roseboom/.rvm/gems/ruby-1.9.3-p125/gems/execjs-1.3.0/lib/execjs/external_runtime.rb:26:in `exec'
/home/Roseboom/.rvm/gems/ruby-1.9.3-p125/gems/execjs-1.3.0/lib/execjs/external_runtime.rb:18:in `eval'
/home/Roseboom/.rvm/gems/ruby-1.9.3-p125/gems/execjs-1.3.0/lib/execjs/external_runtime.rb:32:in `call'
/home/Roseboom/.rvm/gems/ruby-1.9.3-p125/gems/coffee-script-2.2.0/lib/coffee_script.rb:57:in `compile'
/home/Roseboom/.rvm/gems/ruby-1.9.3-p125/gems/tilt-1.3.3/lib/tilt/coffee.rb:46:in `evaluate'
/home/Roseboom/.rvm/gems/ruby-1.9.3-p125/gems/tilt-1.3.3/lib/tilt/template.rb:76:in `render'
/home/Roseboom/.rvm/gems/ruby-1.9.3-p125/gems/sprockets-2.1.2/lib/sprockets/context.rb:177:in `block in evaluate'
/home/Roseboom/.rvm/gems/ruby-1.9.3-p125/gems/sprockets-2.1.2/lib/sprockets/context.rb:174:in `each'
/home/Roseboom/.rvm/gems/ruby-1.9.3-p125/gems/sprockets-2.1.2/lib/sprockets/context.rb:174:in `evaluate'
/home/Roseboom/.rvm/gems/ruby-1.9.3-p125/gems/sprockets-2.1.2/lib/sprockets/processed_asset.rb:12:in `initialize'
/home/Roseboom/.rvm/gems/ruby-1.9.3-p125/gems/sprockets-2.1.2/lib/sprockets/base.rb:241:in `new'
/home/Roseboom/.rvm/gems/ruby-1.9.3-p125/gems/sprockets-2.1.2/lib/sprockets/base.rb:241:in `block in build_asset'
/home/Roseboom/.rvm/gems/ruby-1.9.3-p125/gems/sprockets-2.1.2/lib/sprockets/base.rb:262:in `circular_call_protection'
/home/Roseboom/.rvm/gems/ruby-1.9.3-p125/gems/sprockets-2.1.2/lib/sprockets/base.rb:240:in `build_asset'
/home/Roseboom/.rvm/gems/ruby-1.9.3-p125/gems/sprockets-2.1.2/lib/sprockets/index.rb:89:in `block in build_asset'
/home/Roseboom/.rvm/gems/ruby-1.9.3-p125/gems/sprockets-2.1.2/lib/sprockets/caching.rb:19:in `cache_asset'
/home/Roseboom/.rvm/gems/ruby-1.9.3-p125/gems/sprockets-2.1.2/lib/sprockets/index.rb:88:in `build_asset'
/home/Roseboom/.rvm/gems/ruby-1.9.3-p125/gems/sprockets-2.1.2/lib/sprockets/base.rb:163:in `find_asset'
/home/Roseboom/.rvm/gems/ruby-1.9.3-p125/gems/sprockets-2.1.2/lib/sprockets/index.rb:56:in `find_asset'
/home/Roseboom/.rvm/gems/ruby-1.9.3-p125/gems/sprockets-2.1.2/lib/sprockets/processed_asset.rb:106:in `block in build_required_assets'
/home/Roseboom/.rvm/gems/ruby-1.9.3-p125/gems/sprockets-2.1.2/lib/sprockets/processed_asset.rb:100:in `each'
/home/Roseboom/.rvm/gems/ruby-1.9.3-p125/gems/sprockets-2.1.2/lib/sprockets/processed_asset.rb:100:in `build_required_assets'
/home/Roseboom/.rvm/gems/ruby-1.9.3-p125/gems/sprockets-2.1.2/lib/sprockets/processed_asset.rb:16:in `initialize'
/home/Roseboom/.rvm/gems/ruby-1.9.3-p125/gems/sprockets-2.1.2/lib/sprockets/base.rb:241:in `new'
/home/Roseboom/.rvm/gems/ruby-1.9.3-p125/gems/sprockets-2.1.2/lib/sprockets/base.rb:241:in `block in build_asset'
/home/Roseboom/.rvm/gems/ruby-1.9.3-p125/gems/sprockets-2.1.2/lib/sprockets/base.rb:262:in `circular_call_protection'
/home/Roseboom/.rvm/gems/ruby-1.9.3-p125/gems/sprockets-2.1.2/lib/sprockets/base.rb:240:in `build_asset'
/home/Roseboom/.rvm/gems/ruby-1.9.3-p125/gems/sprockets-2.1.2/lib/sprockets/index.rb:89:in `block in build_asset'
/home/Roseboom/.rvm/gems/ruby-1.9.3-p125/gems/sprockets-2.1.2/lib/sprockets/caching.rb:19:in `cache_asset'
/home/Roseboom/.rvm/gems/ruby-1.9.3-p125/gems/sprockets-2.1.2/lib/sprockets/index.rb:88:in `build_asset'
/home/Roseboom/.rvm/gems/ruby-1.9.3-p125/gems/sprockets-2.1.2/lib/sprockets/base.rb:163:in `find_asset'
/home/Roseboom/.rvm/gems/ruby-1.9.3-p125/gems/sprockets-2.1.2/lib/sprockets/index.rb:56:in `find_asset'
/home/Roseboom/.rvm/gems/ruby-1.9.3-p125/gems/sprockets-2.1.2/lib/sprockets/bundled_asset.rb:16:in `initialize'
/home/Roseboom/.rvm/gems/ruby-1.9.3-p125/gems/sprockets-2.1.2/lib/sprockets/base.rb:244:in `new'
/home/Roseboom/.rvm/gems/ruby-1.9.3-p125/gems/sprockets-2.1.2/lib/sprockets/base.rb:244:in `build_asset'
/home/Roseboom/.rvm/gems/ruby-1.9.3-p125/gems/sprockets-2.1.2/lib/sprockets/index.rb:89:in `block in build_asset'
/home/Roseboom/.rvm/gems/ruby-1.9.3-p125/gems/sprockets-2.1.2/lib/sprockets/caching.rb:19:in `cache_asset'
/home/Roseboom/.rvm/gems/ruby-1.9.3-p125/gems/sprockets-2.1.2/lib/sprockets/index.rb:88:in `build_asset'
/home/Roseboom/.rvm/gems/ruby-1.9.3-p125/gems/sprockets-2.1.2/lib/sprockets/base.rb:163:in `find_asset'
/home/Roseboom/.rvm/gems/ruby-1.9.3-p125/gems/sprockets-2.1.2/lib/sprockets/index.rb:56:in `find_asset'
/home/Roseboom/.rvm/gems/ruby-1.9.3-p125/gems/actionpack-3.2.3/lib/sprockets/static_compiler.rb:20:in `block in compile'
/home/Roseboom/.rvm/gems/ruby-1.9.3-p125/gems/sprockets-2.1.2/lib/sprockets/base.rb:212:in `block in each_logical_path'
/home/Roseboom/.rvm/gems/ruby-1.9.3-p125/gems/sprockets-2.1.2/lib/sprockets/base.rb:200:in `block (2 levels) in each_file'
/home/Roseboom/.rvm/gems/ruby-1.9.3-p125/gems/sprockets-2.1.2/lib/sprockets/base.rb:190:in `each'
/home/Roseboom/.rvm/gems/ruby-1.9.3-p125/gems/sprockets-2.1.2/lib/sprockets/base.rb:190:in `each_entry'
/home/Roseboom/.rvm/gems/ruby-1.9.3-p125/gems/sprockets-2.1.2/lib/sprockets/base.rb:198:in `block in each_file'
/home/Roseboom/.rvm/gems/ruby-1.9.3-p125/gems/sprockets-2.1.2/lib/sprockets/base.rb:197:in `each'
/home/Roseboom/.rvm/gems/ruby-1.9.3-p125/gems/sprockets-2.1.2/lib/sprockets/base.rb:197:in `each_file'
/home/Roseboom/.rvm/gems/ruby-1.9.3-p125/gems/sprockets-2.1.2/lib/sprockets/base.rb:210:in `each_logical_path'
/home/Roseboom/.rvm/gems/ruby-1.9.3-p125/gems/actionpack-3.2.3/lib/sprockets/static_compiler.rb:18:in `compile'
/home/Roseboom/.rvm/gems/ruby-1.9.3-p125/gems/actionpack-3.2.3/lib/sprockets/assets.rake:56:in `internal_precompile'
/home/Roseboom/.rvm/gems/ruby-1.9.3-p125/gems/actionpack-3.2.3/lib/sprockets/assets.rake:70:in `block (3 levels) in <top
(required)>'
/home/Roseboom/.rvm/gems/ruby-1.9.3-p125/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call'
/home/Roseboom/.rvm/gems/ruby-1.9.3-p125/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `block in execute'
/home/Roseboom/.rvm/gems/ruby-1.9.3-p125/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each'
/home/Roseboom/.rvm/gems/ruby-1.9.3-p125/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'
/home/Roseboom/.rvm/gems/ruby-1.9.3-p125/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
/home/Roseboom/.rvm/rubies/ruby-1.9.3-p125/lib64/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/home/Roseboom/.rvm/gems/ruby-1.9.3-p125/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/home/Roseboom/.rvm/gems/ruby-1.9.3-p125/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke'
/home/Roseboom/.rvm/gems/ruby-1.9.3-p125/gems/actionpack-3.2.3/lib/sprockets/assets.rake:60:in `block (3 levels) in <top
(required)>'
/home/Roseboom/.rvm/gems/ruby-1.9.3-p125/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call'
/home/Roseboom/.rvm/gems/ruby-1.9.3-p125/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `block in execute'
/home/Roseboom/.rvm/gems/ruby-1.9.3-p125/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each'
/home/Roseboom/.rvm/gems/ruby-1.9.3-p125/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'
/home/Roseboom/.rvm/gems/ruby-1.9.3-p125/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
/home/Roseboom/.rvm/rubies/ruby-1.9.3-p125/lib64/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/home/Roseboom/.rvm/gems/ruby-1.9.3-p125/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/home/Roseboom/.rvm/gems/ruby-1.9.3-p125/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke'
/home/Roseboom/.rvm/gems/ruby-1.9.3-p125/gems/rake-0.9.2.2/lib/rake/application.rb:116:in `invoke_task'
/home/Roseboom/.rvm/gems/ruby-1.9.3-p125/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block (2 levels) in top_level'
/home/Roseboom/.rvm/gems/ruby-1.9.3-p125/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `each'
/home/Roseboom/.rvm/gems/ruby-1.9.3-p125/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block in top_level'
/home/Roseboom/.rvm/gems/ruby-1.9.3-p125/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/home/Roseboom/.rvm/gems/ruby-1.9.3-p125/gems/rake-0.9.2.2/lib/rake/application.rb:88:in `top_level'
/home/Roseboom/.rvm/gems/ruby-1.9.3-p125/gems/rake-0.9.2.2/lib/rake/application.rb:66:in `block in run'
/home/Roseboom/.rvm/gems/ruby-1.9.3-p125/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/home/Roseboom/.rvm/gems/ruby-1.9.3-p125/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'
/home/Roseboom/.rvm/gems/ruby-1.9.3-p125/gems/rake-0.9.2.2/bin/rake:33:in `<top (required)>'
/home/Roseboom/.rvm/gems/ruby-1.9.3-p125/bin/rake:19:in `load'
/home/Roseboom/.rvm/gems/ruby-1.9.3-p125/bin/rake:19:in `<main>'
Tasks: TOP => assets:precompile:primary
rake aborted!
Command failed with status (1): [/home/Roseboom/.rvm/rubies/ruby-1.9.3-p125...]
/home/Roseboom/.rvm/gems/ruby-1.9.3-p125/gems/rake-0.9.2.2/lib/rake/file_utils.rb:53:in `block in create_shell_runner'
/home/Roseboom/.rvm/gems/ruby-1.9.3-p125/gems/rake-0.9.2.2/lib/rake/file_utils.rb:45:in `call'
/home/Roseboom/.rvm/gems/ruby-1.9.3-p125/gems/rake-0.9.2.2/lib/rake/file_utils.rb:45:in `sh'
/home/Roseboom/.rvm/gems/ruby-1.9.3-p125/gems/rake-0.9.2.2/lib/rake/file_utils_ext.rb:39:in `sh'
/home/Roseboom/.rvm/gems/ruby-1.9.3-p125/gems/rake-0.9.2.2/lib/rake/file_utils.rb:80:in `ruby'
/home/Roseboom/.rvm/gems/ruby-1.9.3-p125/gems/rake-0.9.2.2/lib/rake/file_utils_ext.rb:39:in `ruby'
/home/Roseboom/.rvm/gems/ruby-1.9.3-p125/gems/actionpack-3.2.3/lib/sprockets/assets.rake:12:in `ruby_rake_task'
/home/Roseboom/.rvm/gems/ruby-1.9.3-p125/gems/actionpack-3.2.3/lib/sprockets/assets.rake:21:in `invoke_or_reboot_rake_task'
/home/Roseboom/.rvm/gems/ruby-1.9.3-p125/gems/actionpack-3.2.3/lib/sprockets/assets.rake:29:in `block (2 levels) in <top
(required)>'
/home/Roseboom/.rvm/gems/ruby-1.9.3-p125/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call'
/home/Roseboom/.rvm/gems/ruby-1.9.3-p125/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `block in execute'
/home/Roseboom/.rvm/gems/ruby-1.9.3-p125/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each'
/home/Roseboom/.rvm/gems/ruby-1.9.3-p125/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'
/home/Roseboom/.rvm/gems/ruby-1.9.3-p125/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
/home/Roseboom/.rvm/rubies/ruby-1.9.3-p125/lib64/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/home/Roseboom/.rvm/gems/ruby-1.9.3-p125/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/home/Roseboom/.rvm/gems/ruby-1.9.3-p125/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke'
/home/Roseboom/.rvm/gems/ruby-1.9.3-p125/gems/rake-0.9.2.2/lib/rake/application.rb:116:in `invoke_task'
/home/Roseboom/.rvm/gems/ruby-1.9.3-p125/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block (2 levels) in top_level'
/home/Roseboom/.rvm/gems/ruby-1.9.3-p125/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `each'
/home/Roseboom/.rvm/gems/ruby-1.9.3-p125/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block in top_level'
/home/Roseboom/.rvm/gems/ruby-1.9.3-p125/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/home/Roseboom/.rvm/gems/ruby-1.9.3-p125/gems/rake-0.9.2.2/lib/rake/application.rb:88:in `top_level'
/home/Roseboom/.rvm/gems/ruby-1.9.3-p125/gems/rake-0.9.2.2/lib/rake/application.rb:66:in `block in run'
/home/Roseboom/.rvm/gems/ruby-1.9.3-p125/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/home/Roseboom/.rvm/gems/ruby-1.9.3-p125/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'
/home/Roseboom/.rvm/gems/ruby-1.9.3-p125/gems/rake-0.9.2.2/bin/rake:33:in `<top (required)>'
/home/Roseboom/.rvm/gems/ruby-1.9.3-p125/bin/rake:19:in `load'
/home/Roseboom/.rvm/gems/ruby-1.9.3-p125/bin/rake:19:in `<main>'
Tasks: TOP => assets:precompile
Try to change execjs to therubyracer gem. I had so many problems with execjs before i switched to rubyracer. Now all works.
group :assets do
gem 'sass'
gem 'coffee-script'
gem 'uglifier'
gem 'therubyracer'
end
Cheers!
In my case it was because I used a wrong version of Ruby. Remember to double-check the Ruby version of your project

Undefined mixin 'global-reset' when deploying to Heroku

Any ideas why does this happen when deploying to Heroku:
-----> Preparing app for Rails asset pipeline
Running: rake assets:precompile
rake aborted!
Undefined mixin 'global-reset'.
(in /tmp/build_b4afrg7i0afu/vendor/bundle/ruby/1.9.1/gems/activeadmin-0.3.4/app/assets/stylesheets/active_admin/_base.css.scss)
Tasks: TOP => assets:precompile:primary
(See full trace by running task with --trace)
Precompiling assets failed, enabling runtime asset compilation
Injecting rails31_enable_runtime_asset_compilation
I have an scss file with:
#import "compass/reset";
but why is it not finding it when compiling assets? Is there a way to just not compile them? It works fine at runtime and this step generates an exception that gets into airbrake and it's a pain.
Update: I run rake assets:precompile locally and I found the error seems to be generated by activeadmin:
$ rake assets:precompile --trace
** Invoke assets:precompile (first_time)
** Execute assets:precompile
/Users/pupeno/.rvm/rubies/ruby-1.9.2-p290/bin/ruby /Users/pupeno/.rvm/gems/ruby-1.9.2-p290#watu/bin/rake assets:precompile:all RAILS_ENV=production RAILS_GROUPS=assets --trace
** Invoke assets:precompile:all (first_time)
** Execute assets:precompile:all
** Invoke assets:precompile:primary (first_time)
** Invoke assets:environment (first_time)
** Execute assets:environment
** Invoke environment (first_time)
** Execute environment
** Invoke tmp:cache:clear (first_time)
** Execute tmp:cache:clear
** Execute assets:precompile:primary
rake aborted!
Undefined mixin 'global-reset'.
(in /Users/pupeno/.rvm/gems/ruby-1.9.2-p290#watu/gems/activeadmin-0.4.0/app/assets/stylesheets/active_admin/_base.css.scss)
/Users/pupeno/.rvm/gems/ruby-1.9.2-p290#watu/gems/activeadmin-0.4.0/app/assets/stylesheets/active_admin/_base.css.scss:4:in `global-reset'
/Users/pupeno/.rvm/gems/ruby-1.9.2-p290#watu/gems/activeadmin-0.4.0/app/assets/stylesheets/active_admin/_base.css.scss:4
/Users/pupeno/.rvm/gems/ruby-1.9.2-p290#watu/gems/sass-3.1.12/lib/sass/tree/visitors/perform.rb:170:in `visit_mixin'
/Users/pupeno/.rvm/gems/ruby-1.9.2-p290#watu/gems/sass-3.1.12/lib/sass/tree/visitors/base.rb:37:in `visit'
/Users/pupeno/.rvm/gems/ruby-1.9.2-p290#watu/gems/sass-3.1.12/lib/sass/tree/visitors/perform.rb:18:in `visit'
/Users/pupeno/.rvm/gems/ruby-1.9.2-p290#watu/gems/sass-3.1.12/lib/sass/tree/visitors/base.rb:53:in `block in visit_children'
/Users/pupeno/.rvm/gems/ruby-1.9.2-p290#watu/gems/sass-3.1.12/lib/sass/tree/visitors/base.rb:53:in `map'
/Users/pupeno/.rvm/gems/ruby-1.9.2-p290#watu/gems/sass-3.1.12/lib/sass/tree/visitors/base.rb:53:in `visit_children'
/Users/pupeno/.rvm/gems/ruby-1.9.2-p290#watu/gems/sass-3.1.12/lib/sass/tree/visitors/perform.rb:27:in `block in visit_children'
/Users/pupeno/.rvm/gems/ruby-1.9.2-p290#watu/gems/sass-3.1.12/lib/sass/tree/visitors/perform.rb:39:in `with_environment'
/Users/pupeno/.rvm/gems/ruby-1.9.2-p290#watu/gems/sass-3.1.12/lib/sass/tree/visitors/perform.rb:26:in `visit_children'
/Users/pupeno/.rvm/gems/ruby-1.9.2-p290#watu/gems/sass-3.1.12/lib/sass/tree/visitors/base.rb:37:in `block in visit'
/Users/pupeno/.rvm/gems/ruby-1.9.2-p290#watu/gems/sass-3.1.12/lib/sass/tree/visitors/perform.rb:47:in `visit_root'
/Users/pupeno/.rvm/gems/ruby-1.9.2-p290#watu/gems/sass-3.1.12/lib/sass/tree/visitors/base.rb:37:in `visit'
/Users/pupeno/.rvm/gems/ruby-1.9.2-p290#watu/gems/sass-3.1.12/lib/sass/tree/visitors/perform.rb:18:in `visit'
/Users/pupeno/.rvm/gems/ruby-1.9.2-p290#watu/gems/sass-3.1.12/lib/sass/tree/visitors/perform.rb:7:in `visit'
/Users/pupeno/.rvm/gems/ruby-1.9.2-p290#watu/gems/sass-3.1.12/lib/sass/tree/root_node.rb:20:in `render'
/Users/pupeno/.rvm/gems/ruby-1.9.2-p290#watu/gems/sass-3.1.12/lib/sass/engine.rb:300:in `_render'
/Users/pupeno/.rvm/gems/ruby-1.9.2-p290#watu/gems/sass-3.1.12/lib/sass/engine.rb:247:in `render'
/Users/pupeno/.rvm/gems/ruby-1.9.2-p290#watu/gems/sass-rails-3.1.5/lib/sass/rails/template_handlers.rb:95:in `evaluate'
/Users/pupeno/.rvm/gems/ruby-1.9.2-p290#watu/gems/tilt-1.3.3/lib/tilt/template.rb:76:in `render'
/Users/pupeno/.rvm/gems/ruby-1.9.2-p290#watu/gems/sprockets-2.0.3/lib/sprockets/context.rb:175:in `block in evaluate'
/Users/pupeno/.rvm/gems/ruby-1.9.2-p290#watu/gems/sprockets-2.0.3/lib/sprockets/context.rb:172:in `each'
/Users/pupeno/.rvm/gems/ruby-1.9.2-p290#watu/gems/sprockets-2.0.3/lib/sprockets/context.rb:172:in `evaluate'
/Users/pupeno/.rvm/gems/ruby-1.9.2-p290#watu/gems/sprockets-2.0.3/lib/sprockets/bundled_asset.rb:171:in `build_dependency_context_and_body'
/Users/pupeno/.rvm/gems/ruby-1.9.2-p290#watu/gems/sprockets-2.0.3/lib/sprockets/bundled_asset.rb:135:in `dependency_context'
/Users/pupeno/.rvm/gems/ruby-1.9.2-p290#watu/gems/sprockets-2.0.3/lib/sprockets/bundled_asset.rb:194:in `build_dependencies_paths_and_assets'
/Users/pupeno/.rvm/gems/ruby-1.9.2-p290#watu/gems/sprockets-2.0.3/lib/sprockets/bundled_asset.rb:141:in `dependency_paths'
/Users/pupeno/.rvm/gems/ruby-1.9.2-p290#watu/gems/sprockets-2.0.3/lib/sprockets/bundled_asset.rb:61:in `mtime'
/Users/pupeno/.rvm/gems/ruby-1.9.2-p290#watu/gems/sprockets-2.0.3/lib/sprockets/asset.rb:58:in `block in encode_with'
/Users/pupeno/.rvm/gems/ruby-1.9.2-p290#watu/gems/sprockets-2.0.3/lib/sprockets/asset.rb:57:in `each'
/Users/pupeno/.rvm/gems/ruby-1.9.2-p290#watu/gems/sprockets-2.0.3/lib/sprockets/asset.rb:57:in `encode_with'
/Users/pupeno/.rvm/gems/ruby-1.9.2-p290#watu/gems/sprockets-2.0.3/lib/sprockets/bundled_asset.rb:43:in `encode_with'
/Users/pupeno/.rvm/gems/ruby-1.9.2-p290#watu/gems/sprockets-2.0.3/lib/sprockets/caching.rb:52:in `cache_asset'
/Users/pupeno/.rvm/gems/ruby-1.9.2-p290#watu/gems/sprockets-2.0.3/lib/sprockets/index.rb:67:in `block in build_asset'
/Users/pupeno/.rvm/gems/ruby-1.9.2-p290#watu/gems/sprockets-2.0.3/lib/sprockets/index.rb:76:in `memoize'
/Users/pupeno/.rvm/gems/ruby-1.9.2-p290#watu/gems/sprockets-2.0.3/lib/sprockets/index.rb:65:in `build_asset'
/Users/pupeno/.rvm/gems/ruby-1.9.2-p290#watu/gems/sprockets-2.0.3/lib/sprockets/trail.rb:102:in `find_asset_in_path'
/Users/pupeno/.rvm/gems/ruby-1.9.2-p290#watu/gems/sprockets-2.0.3/lib/sprockets/base.rb:101:in `find_asset'
/Users/pupeno/.rvm/gems/ruby-1.9.2-p290#watu/gems/sprockets-2.0.3/lib/sprockets/index.rb:48:in `find_asset'
/Users/pupeno/.rvm/gems/ruby-1.9.2-p290#watu/gems/actionpack-3.1.3/lib/sprockets/static_compiler.rb:20:in `block in compile'
/Users/pupeno/.rvm/gems/ruby-1.9.2-p290#watu/gems/sprockets-2.0.3/lib/sprockets/base.rb:151:in `block in each_logical_path'
/Users/pupeno/.rvm/gems/ruby-1.9.2-p290#watu/gems/sprockets-2.0.3/lib/sprockets/base.rb:139:in `block (2 levels) in each_file'
/Users/pupeno/.rvm/gems/ruby-1.9.2-p290#watu/gems/sprockets-2.0.3/lib/sprockets/base.rb:129:in `each'
/Users/pupeno/.rvm/gems/ruby-1.9.2-p290#watu/gems/sprockets-2.0.3/lib/sprockets/base.rb:129:in `each_entry'
/Users/pupeno/.rvm/gems/ruby-1.9.2-p290#watu/gems/sprockets-2.0.3/lib/sprockets/base.rb:137:in `block in each_file'
/Users/pupeno/.rvm/gems/ruby-1.9.2-p290#watu/gems/sprockets-2.0.3/lib/sprockets/base.rb:136:in `each'
/Users/pupeno/.rvm/gems/ruby-1.9.2-p290#watu/gems/sprockets-2.0.3/lib/sprockets/base.rb:136:in `each_file'
/Users/pupeno/.rvm/gems/ruby-1.9.2-p290#watu/gems/sprockets-2.0.3/lib/sprockets/base.rb:149:in `each_logical_path'
/Users/pupeno/.rvm/gems/ruby-1.9.2-p290#watu/gems/actionpack-3.1.3/lib/sprockets/static_compiler.rb:18:in `compile'
/Users/pupeno/.rvm/gems/ruby-1.9.2-p290#watu/gems/actionpack-3.1.3/lib/sprockets/assets.rake:52:in `internal_precompile'
/Users/pupeno/.rvm/gems/ruby-1.9.2-p290#watu/gems/actionpack-3.1.3/lib/sprockets/assets.rake:66:in `block (3 levels) in <top (required)>'
/Users/pupeno/.rvm/gems/ruby-1.9.2-p290#watu/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call'
/Users/pupeno/.rvm/gems/ruby-1.9.2-p290#watu/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `block in execute'
/Users/pupeno/.rvm/gems/ruby-1.9.2-p290#watu/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each'
/Users/pupeno/.rvm/gems/ruby-1.9.2-p290#watu/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'
/Users/pupeno/.rvm/gems/ruby-1.9.2-p290#watu/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
/Users/pupeno/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/Users/pupeno/.rvm/gems/ruby-1.9.2-p290#watu/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/Users/pupeno/.rvm/gems/ruby-1.9.2-p290#watu/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke'
/Users/pupeno/.rvm/gems/ruby-1.9.2-p290#watu/gems/actionpack-3.1.3/lib/sprockets/assets.rake:56:in `block (3 levels) in <top (required)>'
/Users/pupeno/.rvm/gems/ruby-1.9.2-p290#watu/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call'
/Users/pupeno/.rvm/gems/ruby-1.9.2-p290#watu/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `block in execute'
/Users/pupeno/.rvm/gems/ruby-1.9.2-p290#watu/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each'
/Users/pupeno/.rvm/gems/ruby-1.9.2-p290#watu/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'
/Users/pupeno/.rvm/gems/ruby-1.9.2-p290#watu/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
/Users/pupeno/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/Users/pupeno/.rvm/gems/ruby-1.9.2-p290#watu/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/Users/pupeno/.rvm/gems/ruby-1.9.2-p290#watu/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke'
/Users/pupeno/.rvm/gems/ruby-1.9.2-p290#watu/gems/rake-0.9.2.2/lib/rake/application.rb:116:in `invoke_task'
/Users/pupeno/.rvm/gems/ruby-1.9.2-p290#watu/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block (2 levels) in top_level'
/Users/pupeno/.rvm/gems/ruby-1.9.2-p290#watu/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `each'
/Users/pupeno/.rvm/gems/ruby-1.9.2-p290#watu/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block in top_level'
/Users/pupeno/.rvm/gems/ruby-1.9.2-p290#watu/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/Users/pupeno/.rvm/gems/ruby-1.9.2-p290#watu/gems/rake-0.9.2.2/lib/rake/application.rb:88:in `top_level'
/Users/pupeno/.rvm/gems/ruby-1.9.2-p290#watu/gems/rake-0.9.2.2/lib/rake/application.rb:66:in `block in run'
/Users/pupeno/.rvm/gems/ruby-1.9.2-p290#watu/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/Users/pupeno/.rvm/gems/ruby-1.9.2-p290#watu/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'
/Users/pupeno/.rvm/gems/ruby-1.9.2-p290#watu/gems/rake-0.9.2.2/bin/rake:33:in `<top (required)>'
/Users/pupeno/.rvm/gems/ruby-1.9.2-p290#watu/bin/rake:19:in `load'
/Users/pupeno/.rvm/gems/ruby-1.9.2-p290#watu/bin/rake:19:in `<main>'
Tasks: TOP => assets:precompile:primary
rake aborted!
I reported this issue in case it's a bug.
Check if you did all of the following:
In config/application.rb, ensure you have the line:
config.assets.initialize_on_precompile = false
If you're loading scss files other than application.css, make sure they're included in the assets pipeline. You'll need a line line the following at the top of the file:
/*= require_self */
In addition to #2, In config/environments/production.rb, add those files to the assets list. For instance, if your file is my.scss, you need a line like:
config.assets.precompile += %w( my.css )
Finally, there's a great guide at http://guides.rubyonrails.org/asset_pipeline.html

rake assets:precompile attempting to connect to database

I'm attempting to debug why my application is attempting to connect to my database when I run rake assets:precompile --trace.
I'm probably missing something in the stack trace...anyone see the pertinent line?
DEPRECATION WARNING: The InstanceMethods module inside ActiveSupport::Concern will be no longer included automatically. Please define instance methods directly in ActionController::Base instead. (called from <top (required)> at /Users/Kyle/Desktop/skateparks-web/config/application.rb:4)
** Invoke assets:precompile (first_time)
** Execute assets:precompile
/Users/Kyle/.rvm/rubies/ruby-1.9.2-p290/bin/ruby /Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/bin/rake assets:precompile:all RAILS_ENV=production RAILS_GROUPS=assets --trace
DEPRECATION WARNING: The InstanceMethods module inside ActiveSupport::Concern will be no longer included automatically. Please define instance methods directly in ActionController::Base instead. (called from <top (required)> at /Users/Kyle/Desktop/skateparks-web/config/application.rb:4)
** Invoke assets:precompile:all (first_time)
** Execute assets:precompile:all
** Invoke assets:precompile:primary (first_time)
** Invoke assets:environment (first_time)
** Execute assets:environment
** Invoke environment (first_time)
** Execute environment
rake aborted!
FATAL: database "skateparks_production" does not exist
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/activerecord-3.2.0/lib/active_record/connection_adapters/postgresql_adapter.rb:1161:in `initialize'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/activerecord-3.2.0/lib/active_record/connection_adapters/postgresql_adapter.rb:1161:in `new'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/activerecord-3.2.0/lib/active_record/connection_adapters/postgresql_adapter.rb:1161:in `connect'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/activerecord-3.2.0/lib/active_record/connection_adapters/postgresql_adapter.rb:316:in `initialize'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/activerecord-3.2.0/lib/active_record/connection_adapters/postgresql_adapter.rb:27:in `new'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/activerecord-3.2.0/lib/active_record/connection_adapters/postgresql_adapter.rb:27:in `postgresql_connection'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/activerecord-3.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:277:in `new_connection'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/activerecord-3.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:287:in `checkout_new_connection'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/activerecord-3.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:235:in `block (2 levels) in checkout'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/activerecord-3.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:230:in `loop'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/activerecord-3.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:230:in `block in checkout'
/Users/Kyle/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/activerecord-3.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:229:in `checkout'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/activerecord-3.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:95:in `connection'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/activerecord-3.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:374:in `retrieve_connection'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/activerecord-3.2.0/lib/active_record/connection_adapters/abstract/connection_specification.rb:168:in `retrieve_connection'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/activerecord-3.2.0/lib/active_record/connection_adapters/abstract/connection_specification.rb:142:in `connection'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/activerecord-3.2.0/lib/active_record/model_schema.rb:308:in `clear_cache!'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/activerecord-3.2.0/lib/active_record/railtie.rb:91:in `block (2 levels) in <class:Railtie>'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/activesupport-3.2.0/lib/active_support/callbacks.rb:418:in `_run__2041913228368879189__prepare__1991931652306887621__callbacks'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/activesupport-3.2.0/lib/active_support/callbacks.rb:405:in `__run_callback'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/activesupport-3.2.0/lib/active_support/callbacks.rb:385:in `_run_prepare_callbacks'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/activesupport-3.2.0/lib/active_support/callbacks.rb:81:in `run_callbacks'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/actionpack-3.2.0/lib/action_dispatch/middleware/reloader.rb:74:in `prepare!'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/actionpack-3.2.0/lib/action_dispatch/middleware/reloader.rb:48:in `prepare!'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/railties-3.2.0/lib/rails/application/finisher.rb:48:in `block in <module:Finisher>'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/railties-3.2.0/lib/rails/initializable.rb:30:in `instance_exec'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/railties-3.2.0/lib/rails/initializable.rb:30:in `run'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/railties-3.2.0/lib/rails/initializable.rb:55:in `block in run_initializers'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/railties-3.2.0/lib/rails/initializable.rb:54:in `each'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/railties-3.2.0/lib/rails/initializable.rb:54:in `run_initializers'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/railties-3.2.0/lib/rails/application.rb:136:in `initialize!'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/railties-3.2.0/lib/rails/railtie/configurable.rb:30:in `method_missing'
/Users/Kyle/Desktop/skateparks-web/config/environment.rb:5:in `<top (required)>'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/activesupport-3.2.0/lib/active_support/dependencies.rb:251:in `require'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/activesupport-3.2.0/lib/active_support/dependencies.rb:251:in `block in require'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/activesupport-3.2.0/lib/active_support/dependencies.rb:236:in `load_dependency'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/activesupport-3.2.0/lib/active_support/dependencies.rb:251:in `require'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/railties-3.2.0/lib/rails/application.rb:103:in `require_environment!'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/railties-3.2.0/lib/rails/application.rb:292:in `block (2 levels) in initialize_tasks'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/task.rb:205:in `call'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/task.rb:205:in `block in execute'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/task.rb:200:in `each'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/task.rb:200:in `execute'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
/Users/Kyle/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/task.rb:144:in `invoke'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/actionpack-3.2.0/lib/sprockets/assets.rake:89:in `block (2 levels) in <top (required)>'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/task.rb:205:in `call'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/task.rb:205:in `block in execute'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/task.rb:200:in `each'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/task.rb:200:in `execute'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
/Users/Kyle/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/task.rb:176:in `block in invoke_prerequisites'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/task.rb:174:in `each'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/task.rb:174:in `invoke_prerequisites'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/task.rb:157:in `block in invoke_with_call_chain'
/Users/Kyle/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/task.rb:144:in `invoke'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/actionpack-3.2.0/lib/sprockets/assets.rake:56:in `block (3 levels) in <top (required)>'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/task.rb:205:in `call'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/task.rb:205:in `block in execute'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/task.rb:200:in `each'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/task.rb:200:in `execute'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
/Users/Kyle/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/task.rb:144:in `invoke'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/application.rb:112:in `invoke_task'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/application.rb:90:in `block (2 levels) in top_level'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/application.rb:90:in `each'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/application.rb:90:in `block in top_level'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/application.rb:84:in `top_level'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/application.rb:62:in `block in run'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/application.rb:59:in `run'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/bin/rake:32:in `<top (required)>'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/bin/rake:19:in `load'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/bin/rake:19:in `<main>'
Tasks: TOP => environment
rake aborted!
Command failed with status (1): [/Users/Kyle/.rvm/rubies/ruby-1.9.2-p290/bi...]
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/file_utils.rb:53:in `block in create_shell_runner'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/file_utils.rb:45:in `call'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/file_utils.rb:45:in `sh'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/file_utils_ext.rb:36:in `sh'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/file_utils.rb:78:in `ruby'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/file_utils_ext.rb:36:in `ruby'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/actionpack-3.2.0/lib/sprockets/assets.rake:9:in `ruby_rake_task'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/actionpack-3.2.0/lib/sprockets/assets.rake:17:in `invoke_or_reboot_rake_task'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/actionpack-3.2.0/lib/sprockets/assets.rake:25:in `block (2 levels) in <top (required)>'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/task.rb:205:in `call'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/task.rb:205:in `block in execute'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/task.rb:200:in `each'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/task.rb:200:in `execute'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
/Users/Kyle/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/task.rb:144:in `invoke'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/application.rb:112:in `invoke_task'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/application.rb:90:in `block (2 levels) in top_level'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/application.rb:90:in `each'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/application.rb:90:in `block in top_level'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/application.rb:84:in `top_level'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/application.rb:62:in `block in run'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/application.rb:59:in `run'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/bin/rake:32:in `<top (required)>'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/bin/rake:19:in `load'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/bin/rake:19:in `<main>'
Tasks: TOP => assets:precompile
rake assets:precompile initializes your app by default, which includes connection to the database.
Inside config/application.rb you can add this, but see the link below for warnings about it:
config.assets.initialize_on_precompile = false
Rails Guide on Precompiling Assets
I had that same problem. After updating Sprockets to version 3, whenever I tried to precompile the assets locally (development), however using the settings of the production environment, I had this error:
rake aborted!
Gem::LoadError: Specified 'postgresql' for database adapter, but the gem is not loaded. Add gem 'pg' to your Gemfile (and ensure its version is at the minimum required by ActiveRecord).
Because in my local (development) I use MySQL and in the server (production), I use Postgres.
The answer marked as resolved does not work for me, because config.assets.initialize_on_precompile is not available in Rails 4.2.1.
To solve, I followed 3 simple steps:
In your Gemfile, add: gem "activerecord-nulldb-adapter"
In database.yml, change the adapter as follow:
production:
adapter: <%= ENV['DB_ADAPTER'] ||= 'postgresql' %>
To compile your production assets locally. run in your terminal
DB_ADAPTER=nulldb RAILS_ENV=production rake assets:precompile
This solutions solved to me and I sawyed here.
Newer versions of Rails do not load the database during asset precompile. However, initializers will often cause it to load. This can be frustrating to debug, because the error omits the stack trace.
./bin/rails assets:precompile
(in ~/src/nautilus)
rake aborted!
ActiveRecord::NoDatabaseError: FATAL: database "your_app_development" does not exist
bundler: failed to load command: rake (~/src/your_app/vendor/bundle/ruby/2.6.0/bin/rake)
NoMethodError: undefined method `reject' for nil:NilClass
The less than helpful error.
So, how do we figure out where the problem is?
Move all the initializers out of config/initializers then run ./bin/rails assets:precompile.
If it works, great, you know the problem is in one of those files.
Move them back one by one till you find the offending file(s).
Now that the problem was found, how do we fix it?
Then when I find an initialilzer that has a problem I wrap it with the following check:
unless ARGV.include? "assets:precompile"
# ...
end
I prefer this over the nulldb because it reduces the number of dependencies I have to maintain in the app.
If it makes sense in your situation, you can choose against which environment assets:precompile should work, with the following command:
rake assets:precompile:all RAILS_ENV=development RAILS_GROUPS=assets
This make sense for my deployment because usually:
I make rake to generates assets on my development machine (because the memory of my vps is somehow limited)
I zip all the application with the assets generated in public/assets
I transfer the zip to the vps ans unzip the package there
Hope it helps.
Check your configuration files (in all environments). If for example
rake assets:precompile
works in development, but you are having issues in production
RAILS_ENV=production bundle exec rake assets:precompile
then you most likely have a reference to active record in your /config/environments/production.rb
config.active_record.dump_schema_after_migration = false
In order to avoid that altogether if you are planning on not taking advantage of active record or employing a NoSQL such as mongo, you may wish to initialize your new app as follows:
rails new myApp --skip-active-record
which is equivalent to -O (capital O) as far as I am concerned.
Maybe this won't work for all cases but I was able to avoid Rails attempting to connect to the database on the rake assets:* tasks by surrounding the code in some places with the snippet below on the /config/routes.rb:
unless defined?(::Rake::SprocketsTask)
devise_for ...
#...
end
devise_scope ...
#...
end
end
Sometimes code which depends on external services or environment variables will get loaded because of code on the initializer files which are not required for assets to be precompiled.
I've recently faced a similar issue and the responses above didn't work for me. I've found the file on config/initializers/ that was causing the issue and wrapped it with the following code:
unless defined?(::Rake::SprocketsTask)
#...
end
The snippet above will skip the code within it when running rake assets:precompile or others like rake assets:clean as well.
Hopefully this will help others in the future!

Resources