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

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

Related

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.

Rake aborted! Invalid byte sequence in UTF-8

This problem has been plaguing me for hours! When trying to precompile my assets on the AWS instance, I get the following:
bitnami#ip-10-117-75-230:/opt/bitnami/apache2/htdocs/my_broker_app$ sudo bundle exec rake assets:precompile --trace
** Invoke assets:precompile (first_time)
** Execute assets:precompile
/opt/bitnami/ruby/bin/ruby /opt/bitnami/ruby/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!
invalid byte sequence in UTF-8
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/hike-1.2.3/lib/hike/index.rb:82:in `block in entries'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/hike-1.2.3/lib/hike/index.rb:82:in `reject'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/hike-1.2.3/lib/hike/index.rb:82:in `entries'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/sprockets-2.2.2/lib/sprockets/base.rb:116:in `entries'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/sprockets-2.2.2/lib/sprockets/base.rb:185:in `each_entry'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/sprockets-2.2.2/lib/sprockets/base.rb:190:in `block in each_entry'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/sprockets-2.2.2/lib/sprockets/base.rb:185:in `each'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/sprockets-2.2.2/lib/sprockets/base.rb:185:in `each_entry'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/sprockets-2.2.2/lib/sprockets/base.rb:190:in `block in each_entry'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/sprockets-2.2.2/lib/sprockets/base.rb:185:in `each'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/sprockets-2.2.2/lib/sprockets/base.rb:185:in `each_entry'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/sprockets-2.2.2/lib/sprockets/base.rb:190:in `block in each_entry'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/sprockets-2.2.2/lib/sprockets/base.rb:185:in `each'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/sprockets-2.2.2/lib/sprockets/base.rb:185:in `each_entry'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/sprockets-2.2.2/lib/sprockets/base.rb:190:in `block in each_entry'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/sprockets-2.2.2/lib/sprockets/base.rb:185:in `each'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/sprockets-2.2.2/lib/sprockets/base.rb:185:in `each_entry'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/sprockets-2.2.2/lib/sprockets/base.rb:204:in `block in each_file'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/sprockets-2.2.2/lib/sprockets/base.rb:203:in `each'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/sprockets-2.2.2/lib/sprockets/base.rb:203:in `each_file'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/sprockets-2.2.2/lib/sprockets/base.rb:217:in `each_logical_path'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/actionpack-3.2.13/lib/sprockets/static_compiler.rb:18:in `compile'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/actionpack-3.2.13/lib/sprockets/assets.rake:56:in `internal_precompile'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/actionpack-3.2.13/lib/sprockets/assets.rake:70:in `block (3 levels) in <top (required)>'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:246:in `call'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:246:in `block in execute'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:241:in `each'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:241:in `execute'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:184:in `block in invoke_with_call_chain'
/opt/bitnami/ruby/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:177:in `invoke_with_call_chain'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:170:in `invoke'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/actionpack-3.2.13/lib/sprockets/assets.rake:60:in `block (3 levels) in <top (required)>'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:246:in `call'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:246:in `block in execute'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:241:in `each'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:241:in `execute'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:184:in `block in invoke_with_call_chain'
/opt/bitnami/ruby/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:177:in `invoke_with_call_chain'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:170:in `invoke'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:143:in `invoke_task'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:101:in `block (2 levels) in top_level'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:101:in `each'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:101:in `block in top_level'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:110:in `run_with_threads'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:95:in `top_level'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:73:in `block in run'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:160:in `standard_exception_handling'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:70:in `run'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/bin/rake:33:in `<top (required)>'
/opt/bitnami/ruby/bin/rake:23:in `load'
/opt/bitnami/ruby/bin/rake:23:in `<main>'
Tasks: TOP => assets:precompile:primary
rake aborted!
Command failed with status (1): [/opt/bitnami/ruby/bin/ruby /opt/bitnami/ru...]
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/file_utils.rb:53:in `block in create_shell_runner'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/file_utils.rb:45:in `call'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/file_utils.rb:45:in `sh'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/file_utils_ext.rb:37:in `sh'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/file_utils.rb:80:in `ruby'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/file_utils_ext.rb:37:in `ruby'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/actionpack-3.2.13/lib/sprockets/assets.rake:12:in `ruby_rake_task'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/actionpack-3.2.13/lib/sprockets/assets.rake:21:in `invoke_or_reboot_rake_task'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/actionpack-3.2.13/lib/sprockets/assets.rake:29:in `block (2 levels) in <top (required)>'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:246:in `call'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:246:in `block in execute'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:241:in `each'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:241:in `execute'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:184:in `block in invoke_with_call_chain'
/opt/bitnami/ruby/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:177:in `invoke_with_call_chain'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:170:in `invoke'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:143:in `invoke_task'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:101:in `block (2 levels) in top_level'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:101:in `each'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:101:in `block in top_level'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:110:in `run_with_threads'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:95:in `top_level'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:73:in `block in run'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:160:in `standard_exception_handling'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:70:in `run'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/bin/rake:33:in `<top (required)>'
/opt/bitnami/ruby/bin/rake:23:in `load'
/opt/bitnami/ruby/bin/rake:23:in `<main>'
Tasks: TOP => assets:precompile
I am running ruby 1.9.3p327 (2012-11-10 revision 37606) [x86_64-linux]
I solved the issue by doing the following:
$ cd opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/hike-1.2.3/lib/hike
$ sudo chmod 777 index.rb
$ sudo vim index.rb
Then, insert (press letter i on keyboard): # encoding: utf-8 before first line.
Hit esc and then type :wq then press enter to save.
After, put permissions back for index.rb by doing the following
$ sudo chmod 644 index.rb
Hope this helps someone in the future.
In case anybody else comes across this question, while Tomanow's answer didn't quite work for me, I discovered there were offending characters in my file, which is what caused this issue.
The files, which came from Open Layers version 2.13, contained a copyright symbol in the comments section of some of their javascript and css files. Anybody else having a similar issue could also attempt to look for and remove those characters, if that's a feasible. Check out this answer for more details.
In my case the issue was happening on every rake task. I found out that it was due to the presence of some files with odd names that were accidentally created on the app's main directory, such as "?," and "\342,". Everything worked fine after I removed them.

rake assets:precompile fails

I have an Rails app that is working fine in development. I'm developing it in RubyMine but I test and run it from the Terminal (files are stored/run on a Ubuntu workstation that I access with Terminal from OSX) using Webrick and sqlite3.
The app uses a modified Boostrap-template and it works fine.
Now I wanted to try to run it in production mode.
This is what I did:
Rails version is 3.2.11, I use rvm 1.8.1 with ruby-1.9.2-p290
config.logger = Logger.new(STDOUT) in environment/production.rb
config.serve_static_assets = true in environment/production.rb
export RAILS_ENV=production
rake db:migrate (works fine)
rake assets:precompile --trace
I get the following error:
peter#fshsweden:/var/www/prod/mackmyra2.dnsalias.com$ rake assets:precompile --trace
** Invoke assets:precompile (first_time)
** Execute assets:precompile
/home/peter/.rvm/rubies/ruby-1.9.2-p290/bin/ruby /home/peter/.rvm/gems/ruby-1.9.2-p290/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
Compiled jquery.js (2ms) (pid 4521)
Compiled jquery_ujs.js (0ms) (pid 4521)
Compiled bootstrap.js (0ms) (pid 4521)
Compiled articles.js (68ms) (pid 4521)
Compiled lightbox.js (0ms) (pid 4521)
Compiled main.js (0ms) (pid 4521)
Compiled prettify.js (0ms) (pid 4521)
Compiled public.js (1ms) (pid 4521)
Compiled small_articles.js (0ms) (pid 4521)
Compiled application.js (142ms) (pid 4521)
Compiled application.css (4744ms) (pid 4521)
rake aborted!
/var/www/prod/mackmyra2.dnsalias.com/app/views/articles/_form.html.erb:6: syntax error, unexpected ')'
... 'form-horizontal'} ) do |ff| ).to_s); _erbout.concat "\n"
... ^
/var/www/prod/mackmyra2.dnsalias.com/app/views/articles/_form.html.erb:45: syntax error, unexpected keyword_ensure, expecting ')'
/var/www/prod/mackmyra2.dnsalias.com/app/views/articles/_form.html.erb:47: syntax error, unexpected keyword_end, expecting ')'
(in /var/www/prod/mackmyra2.dnsalias.com/app/views/articles/_form.html.erb)
/home/peter/.rvm/gems/ruby-1.9.2-p290/gems/tilt-1.3.3/lib/tilt/template.rb:209:in `instance_eval'
/home/peter/.rvm/gems/ruby-1.9.2-p290/gems/tilt-1.3.3/lib/tilt/template.rb:209:in `evaluate_source'
/home/peter/.rvm/gems/ruby-1.9.2-p290/gems/tilt-1.3.3/lib/tilt/template.rb:144:in `cached_evaluate'
/home/peter/.rvm/gems/ruby-1.9.2-p290/gems/tilt-1.3.3/lib/tilt/template.rb:127:in `evaluate'
/home/peter/.rvm/gems/ruby-1.9.2-p290/gems/tilt-1.3.3/lib/tilt/template.rb:76:in `render'
/home/peter/.rvm/gems/ruby-1.9.2-p290/gems/sprockets-2.2.2/lib/sprockets/context.rb:193:in `block in evaluate'
/home/peter/.rvm/gems/ruby-1.9.2-p290/gems/sprockets-2.2.2/lib/sprockets/context.rb:190:in `each'
/home/peter/.rvm/gems/ruby-1.9.2-p290/gems/sprockets-2.2.2/lib/sprockets/context.rb:190:in `evaluate'
/home/peter/.rvm/gems/ruby-1.9.2-p290/gems/sprockets-2.2.2/lib/sprockets/processed_asset.rb:12:in `initialize'
/home/peter/.rvm/gems/ruby-1.9.2-p290/gems/sprockets-2.2.2/lib/sprockets/base.rb:249:in `new'
/home/peter/.rvm/gems/ruby-1.9.2-p290/gems/sprockets-2.2.2/lib/sprockets/base.rb:249:in `block in build_asset'
/home/peter/.rvm/gems/ruby-1.9.2-p290/gems/sprockets-2.2.2/lib/sprockets/base.rb:270:in `circular_call_protection'
/home/peter/.rvm/gems/ruby-1.9.2-p290/gems/sprockets-2.2.2/lib/sprockets/base.rb:248:in `build_asset'
/home/peter/.rvm/gems/ruby-1.9.2-p290/gems/sprockets-2.2.2/lib/sprockets/index.rb:93:in `block in build_asset'
/home/peter/.rvm/gems/ruby-1.9.2-p290/gems/sprockets-2.2.2/lib/sprockets/caching.rb:19:in `cache_asset'
/home/peter/.rvm/gems/ruby-1.9.2-p290/gems/sprockets-2.2.2/lib/sprockets/index.rb:92:in `build_asset'
/home/peter/.rvm/gems/ruby-1.9.2-p290/gems/sprockets-2.2.2/lib/sprockets/base.rb:169:in `find_asset'
/home/peter/.rvm/gems/ruby-1.9.2-p290/gems/sprockets-2.2.2/lib/sprockets/index.rb:60:in `find_asset'
/home/peter/.rvm/gems/ruby-1.9.2-p290/gems/sprockets-2.2.2/lib/sprockets/bundled_asset.rb:16:in `initialize'
/home/peter/.rvm/gems/ruby-1.9.2-p290/gems/sprockets-2.2.2/lib/sprockets/base.rb:252:in `new'
/home/peter/.rvm/gems/ruby-1.9.2-p290/gems/sprockets-2.2.2/lib/sprockets/base.rb:252:in `build_asset'
/home/peter/.rvm/gems/ruby-1.9.2-p290/gems/sprockets-2.2.2/lib/sprockets/index.rb:93:in `block in build_asset'
/home/peter/.rvm/gems/ruby-1.9.2-p290/gems/sprockets-2.2.2/lib/sprockets/caching.rb:19:in `cache_asset'
/home/peter/.rvm/gems/ruby-1.9.2-p290/gems/sprockets-2.2.2/lib/sprockets/index.rb:92:in `build_asset'
/home/peter/.rvm/gems/ruby-1.9.2-p290/gems/sprockets-2.2.2/lib/sprockets/base.rb:169:in `find_asset'
/home/peter/.rvm/gems/ruby-1.9.2-p290/gems/sprockets-2.2.2/lib/sprockets/index.rb:60:in `find_asset'
/home/peter/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.2.11/lib/sprockets/static_compiler.rb:19:in `block in compile'
/home/peter/.rvm/gems/ruby-1.9.2-p290/gems/sprockets-2.2.2/lib/sprockets/base.rb:219:in `block in each_logical_path'
/home/peter/.rvm/gems/ruby-1.9.2-p290/gems/sprockets-2.2.2/lib/sprockets/base.rb:206:in `block (2 levels) in each_file'
/home/peter/.rvm/gems/ruby-1.9.2-p290/gems/sprockets-2.2.2/lib/sprockets/base.rb:196:in `each'
/home/peter/.rvm/gems/ruby-1.9.2-p290/gems/sprockets-2.2.2/lib/sprockets/base.rb:196:in `each_entry'
/home/peter/.rvm/gems/ruby-1.9.2-p290/gems/sprockets-2.2.2/lib/sprockets/base.rb:204:in `block in each_file'
/home/peter/.rvm/gems/ruby-1.9.2-p290/gems/sprockets-2.2.2/lib/sprockets/base.rb:203:in `each'
/home/peter/.rvm/gems/ruby-1.9.2-p290/gems/sprockets-2.2.2/lib/sprockets/base.rb:203:in `each_file'
/home/peter/.rvm/gems/ruby-1.9.2-p290/gems/sprockets-2.2.2/lib/sprockets/base.rb:217:in `each_logical_path'
/home/peter/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.2.11/lib/sprockets/static_compiler.rb:18:in `compile'
/home/peter/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.2.11/lib/sprockets/assets.rake:56:in `internal_precompile'
/home/peter/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.2.11/lib/sprockets/assets.rake:70:in `block (3 levels) in <top (required)>'
/home/peter/.rvm/gems/ruby-1.9.2-p290/gems/rake-10.0.3/lib/rake/task.rb:228:in `call'
/home/peter/.rvm/gems/ruby-1.9.2-p290/gems/rake-10.0.3/lib/rake/task.rb:228:in `block in execute'
/home/peter/.rvm/gems/ruby-1.9.2-p290/gems/rake-10.0.3/lib/rake/task.rb:223:in `each'
/home/peter/.rvm/gems/ruby-1.9.2-p290/gems/rake-10.0.3/lib/rake/task.rb:223:in `execute'
/home/peter/.rvm/gems/ruby-1.9.2-p290/gems/rake-10.0.3/lib/rake/task.rb:166:in `block in invoke_with_call_chain'
/home/peter/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/home/peter/.rvm/gems/ruby-1.9.2-p290/gems/rake-10.0.3/lib/rake/task.rb:159:in `invoke_with_call_chain'
/home/peter/.rvm/gems/ruby-1.9.2-p290/gems/rake-10.0.3/lib/rake/task.rb:152:in `invoke'
/home/peter/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.2.11/lib/sprockets/assets.rake:60:in `block (3 levels) in <top (required)>'
/home/peter/.rvm/gems/ruby-1.9.2-p290/gems/rake-10.0.3/lib/rake/task.rb:228:in `call'
/home/peter/.rvm/gems/ruby-1.9.2-p290/gems/rake-10.0.3/lib/rake/task.rb:228:in `block in execute'
/home/peter/.rvm/gems/ruby-1.9.2-p290/gems/rake-10.0.3/lib/rake/task.rb:223:in `each'
/home/peter/.rvm/gems/ruby-1.9.2-p290/gems/rake-10.0.3/lib/rake/task.rb:223:in `execute'
/home/peter/.rvm/gems/ruby-1.9.2-p290/gems/rake-10.0.3/lib/rake/task.rb:166:in `block in invoke_with_call_chain'
/home/peter/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/home/peter/.rvm/gems/ruby-1.9.2-p290/gems/rake-10.0.3/lib/rake/task.rb:159:in `invoke_with_call_chain'
/home/peter/.rvm/gems/ruby-1.9.2-p290/gems/rake-10.0.3/lib/rake/task.rb:152:in `invoke'
/home/peter/.rvm/gems/ruby-1.9.2-p290/gems/rake-10.0.3/lib/rake/application.rb:143:in `invoke_task'
/home/peter/.rvm/gems/ruby-1.9.2-p290/gems/rake-10.0.3/lib/rake/application.rb:101:in `block (2 levels) in top_level'
/home/peter/.rvm/gems/ruby-1.9.2-p290/gems/rake-10.0.3/lib/rake/application.rb:101:in `each'
/home/peter/.rvm/gems/ruby-1.9.2-p290/gems/rake-10.0.3/lib/rake/application.rb:101:in `block in top_level'
/home/peter/.rvm/gems/ruby-1.9.2-p290/gems/rake-10.0.3/lib/rake/application.rb:110:in `run_with_threads'
/home/peter/.rvm/gems/ruby-1.9.2-p290/gems/rake-10.0.3/lib/rake/application.rb:95:in `top_level'
/home/peter/.rvm/gems/ruby-1.9.2-p290/gems/rake-10.0.3/lib/rake/application.rb:73:in `block in run'
/home/peter/.rvm/gems/ruby-1.9.2-p290/gems/rake-10.0.3/lib/rake/application.rb:160:in `standard_exception_handling'
/home/peter/.rvm/gems/ruby-1.9.2-p290/gems/rake-10.0.3/lib/rake/application.rb:70:in `run'
/home/peter/.rvm/gems/ruby-1.9.2-p290/gems/rake-10.0.3/bin/rake:33:in `<top (required)>'
/home/peter/.rvm/gems/ruby-1.9.2-p290/bin/rake:23:in `load'
/home/peter/.rvm/gems/ruby-1.9.2-p290/bin/rake:23:in `<main>'
Tasks: TOP => assets:precompile:primary
rake aborted!
Command failed with status (1): [/home/peter/.rvm/rubies/ruby-1.9.2-p290/bi...]
/home/peter/.rvm/gems/ruby-1.9.2-p290/gems/rake-10.0.3/lib/rake/file_utils.rb:53:in `block in create_shell_runner'
/home/peter/.rvm/gems/ruby-1.9.2-p290/gems/rake-10.0.3/lib/rake/file_utils.rb:45:in `call'
/home/peter/.rvm/gems/ruby-1.9.2-p290/gems/rake-10.0.3/lib/rake/file_utils.rb:45:in `sh'
/home/peter/.rvm/gems/ruby-1.9.2-p290/gems/rake-10.0.3/lib/rake/file_utils_ext.rb:40:in `sh'
/home/peter/.rvm/gems/ruby-1.9.2-p290/gems/rake-10.0.3/lib/rake/file_utils.rb:80:in `ruby'
/home/peter/.rvm/gems/ruby-1.9.2-p290/gems/rake-10.0.3/lib/rake/file_utils_ext.rb:40:in `ruby'
/home/peter/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.2.11/lib/sprockets/assets.rake:12:in `ruby_rake_task'
/home/peter/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.2.11/lib/sprockets/assets.rake:21:in `invoke_or_reboot_rake_task'
/home/peter/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.2.11/lib/sprockets/assets.rake:29:in `block (2 levels) in <top (required)>'
/home/peter/.rvm/gems/ruby-1.9.2-p290/gems/rake-10.0.3/lib/rake/task.rb:228:in `call'
/home/peter/.rvm/gems/ruby-1.9.2-p290/gems/rake-10.0.3/lib/rake/task.rb:228:in `block in execute'
/home/peter/.rvm/gems/ruby-1.9.2-p290/gems/rake-10.0.3/lib/rake/task.rb:223:in `each'
/home/peter/.rvm/gems/ruby-1.9.2-p290/gems/rake-10.0.3/lib/rake/task.rb:223:in `execute'
/home/peter/.rvm/gems/ruby-1.9.2-p290/gems/rake-10.0.3/lib/rake/task.rb:166:in `block in invoke_with_call_chain'
/home/peter/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/home/peter/.rvm/gems/ruby-1.9.2-p290/gems/rake-10.0.3/lib/rake/task.rb:159:in `invoke_with_call_chain'
/home/peter/.rvm/gems/ruby-1.9.2-p290/gems/rake-10.0.3/lib/rake/task.rb:152:in `invoke'
/home/peter/.rvm/gems/ruby-1.9.2-p290/gems/rake-10.0.3/lib/rake/application.rb:143:in `invoke_task'
/home/peter/.rvm/gems/ruby-1.9.2-p290/gems/rake-10.0.3/lib/rake/application.rb:101:in `block (2 levels) in top_level'
/home/peter/.rvm/gems/ruby-1.9.2-p290/gems/rake-10.0.3/lib/rake/application.rb:101:in `each'
/home/peter/.rvm/gems/ruby-1.9.2-p290/gems/rake-10.0.3/lib/rake/application.rb:101:in `block in top_level'
/home/peter/.rvm/gems/ruby-1.9.2-p290/gems/rake-10.0.3/lib/rake/application.rb:110:in `run_with_threads'
/home/peter/.rvm/gems/ruby-1.9.2-p290/gems/rake-10.0.3/lib/rake/application.rb:95:in `top_level'
/home/peter/.rvm/gems/ruby-1.9.2-p290/gems/rake-10.0.3/lib/rake/application.rb:73:in `block in run'
/home/peter/.rvm/gems/ruby-1.9.2-p290/gems/rake-10.0.3/lib/rake/application.rb:160:in `standard_exception_handling'
/home/peter/.rvm/gems/ruby-1.9.2-p290/gems/rake-10.0.3/lib/rake/application.rb:70:in `run'
/home/peter/.rvm/gems/ruby-1.9.2-p290/gems/rake-10.0.3/bin/rake:33:in `<top (required)>'
/home/peter/.rvm/gems/ruby-1.9.2-p290/bin/rake:23:in `load'
/home/peter/.rvm/gems/ruby-1.9.2-p290/bin/rake:23:in `<main>'
Tasks: TOP => assets:precompile
Now if I do the above on a clean rails app, it works. But it fails on my app that I thought was working. Can you give any pointers about what is wrong?
The _form.rb is btw a partial with a simple_form call, nothing special at all.
(Just two lines shown here to show where the error seems to occur)
<%= yield :title %>
<%= simple_form_for(#article, :html => {:multipart => true, :class => 'form-horizontal'} ) do |ff| %>
Any help is appreciated!
OK this turned out to be a goof by me. When solving some other asset problem a few weeks ago, I had fiddled around with (in config/application.rb)
config.assets.paths << "#{Rails.root}/app/assets"
and accidentally added (In some desperate move I guess)
config.assets.paths << "#{Rails.root}/app"
This of course included EVERYTHING under app as assets, which was horribly wrong.
This error did show up until I had to do a rake assets:precompile. Since I didnt really have a clue what that command did, I didn't see that it was trying to compile view ERB files as assets.
After finding this article: http://blog.55minutes.com/2012/02/untangling-the-rails-asset-pipeline-part-2-production/ I realised that it was erroneously including the view files and it had to be a path problem.
Small error but very difficult to fix. Sort of the Rails standard.

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

Ruby on Rails Rake assets:precompile error

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.

Resources