(undefined method `mtime' for nil:NilClass) #2328

Closed
timstephenson opened this Issue Jul 28, 2011 · 6 comments

Projects

None yet

4 participants

@timstephenson

Hi

I ran into a problem deploying 'rails', '3.1.0.rc5' to heroku. When rendering the templates, I get

ActionView::Template::Error (undefined method `mtime' for nil:NilClass).

When I try to run rake assets:precompile locally, I get the same error. Here is the trace after running the rake task:

rake assets:precompile --trace
** Invoke assets:precompile (first_time)
** Invoke assets:ensure_env (first_time)
** Execute assets:ensure_env
** Execute assets:precompile
** Invoke environment (first_time)
** Execute environment
rake aborted!
undefined method `mtime' for nil:NilClass
/Users/timstephenson/.rvm/gems/ruby-1.9.2-p180@mosaic/gems/activesupport-3.1.0.rc5/lib/active_support/whiny_nil.rb:48:in `method_missing'
/Users/timstephenson/.rvm/gems/ruby-1.9.2-p180@mosaic/gems/sprockets-2.0.0.beta.12/lib/sprockets/bundled_asset.rb:203:in `block in build_dependencies_paths_and_assets'
/Users/timstephenson/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/set.rb:222:in `block in each'
/Users/timstephenson/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/set.rb:222:in `each_key'
/Users/timstephenson/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/set.rb:222:in `each'
/Users/timstephenson/.rvm/gems/ruby-1.9.2-p180@mosaic/gems/sprockets-2.0.0.beta.12/lib/sprockets/bundled_asset.rb:200:in `build_dependencies_paths_and_assets'
/Users/timstephenson/.rvm/gems/ruby-1.9.2-p180@mosaic/gems/sprockets-2.0.0.beta.12/lib/sprockets/bundled_asset.rb:141:in `dependency_paths'
/Users/timstephenson/.rvm/gems/ruby-1.9.2-p180@mosaic/gems/sprockets-2.0.0.beta.12/lib/sprockets/bundled_asset.rb:61:in `mtime'
/Users/timstephenson/.rvm/gems/ruby-1.9.2-p180@mosaic/gems/sprockets-2.0.0.beta.12/lib/sprockets/asset.rb:58:in `block in encode_with'
/Users/timstephenson/.rvm/gems/ruby-1.9.2-p180@mosaic/gems/sprockets-2.0.0.beta.12/lib/sprockets/asset.rb:57:in `each'
/Users/timstephenson/.rvm/gems/ruby-1.9.2-p180@mosaic/gems/sprockets-2.0.0.beta.12/lib/sprockets/asset.rb:57:in `encode_with'
/Users/timstephenson/.rvm/gems/ruby-1.9.2-p180@mosaic/gems/sprockets-2.0.0.beta.12/lib/sprockets/bundled_asset.rb:43:in `encode_with'
/Users/timstephenson/.rvm/gems/ruby-1.9.2-p180@mosaic/gems/sprockets-2.0.0.beta.12/lib/sprockets/caching.rb:48:in `cache_asset'
/Users/timstephenson/.rvm/gems/ruby-1.9.2-p180@mosaic/gems/sprockets-2.0.0.beta.12/lib/sprockets/environment.rb:84:in `build_asset'
/Users/timstephenson/.rvm/gems/ruby-1.9.2-p180@mosaic/gems/sprockets-2.0.0.beta.12/lib/sprockets/trail.rb:111:in `find_asset_in_path'
/Users/timstephenson/.rvm/gems/ruby-1.9.2-p180@mosaic/gems/sprockets-2.0.0.beta.12/lib/sprockets/base.rb:102:in `find_asset'
/Users/timstephenson/.rvm/gems/ruby-1.9.2-p180@mosaic/gems/sprockets-2.0.0.beta.12/lib/sprockets/environment.rb:74:in `find_asset'
/Users/timstephenson/.rvm/gems/ruby-1.9.2-p180@mosaic/gems/sprockets-2.0.0.beta.12/lib/sprockets/static_compilation.rb:44:in `block (2 levels) in precompile'
/Users/timstephenson/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/set.rb:222:in `block in each'
/Users/timstephenson/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/set.rb:222:in `each_key'
/Users/timstephenson/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/set.rb:222:in `each'
/Users/timstephenson/.rvm/gems/ruby-1.9.2-p180@mosaic/gems/sprockets-2.0.0.beta.12/lib/sprockets/static_compilation.rb:35:in `block in precompile'
/Users/timstephenson/.rvm/gems/ruby-1.9.2-p180@mosaic/gems/sprockets-2.0.0.beta.12/lib/sprockets/static_compilation.rb:34:in `each'
/Users/timstephenson/.rvm/gems/ruby-1.9.2-p180@mosaic/gems/sprockets-2.0.0.beta.12/lib/sprockets/static_compilation.rb:34:in `precompile'
/Users/timstephenson/.rvm/gems/ruby-1.9.2-p180@mosaic/gems/actionpack-3.1.0.rc5/lib/sprockets/assets.rake:14:in `block (2 levels) in <top (required)>'
/Users/timstephenson/.rvm/gems/ruby-1.9.2-p180@global/gems/rake-0.9.2/lib/rake/task.rb:205:in `call'
/Users/timstephenson/.rvm/gems/ruby-1.9.2-p180@global/gems/rake-0.9.2/lib/rake/task.rb:205:in `block in execute'
/Users/timstephenson/.rvm/gems/ruby-1.9.2-p180@global/gems/rake-0.9.2/lib/rake/task.rb:200:in `each'
/Users/timstephenson/.rvm/gems/ruby-1.9.2-p180@global/gems/rake-0.9.2/lib/rake/task.rb:200:in `execute'
/Users/timstephenson/.rvm/gems/ruby-1.9.2-p180@global/gems/rake-0.9.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
/Users/timstephenson/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/Users/timstephenson/.rvm/gems/ruby-1.9.2-p180@global/gems/rake-0.9.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/Users/timstephenson/.rvm/gems/ruby-1.9.2-p180@global/gems/rake-0.9.2/lib/rake/task.rb:144:in `invoke'
/Users/timstephenson/.rvm/gems/ruby-1.9.2-p180@global/gems/rake-0.9.2/lib/rake/application.rb:112:in `invoke_task'
/Users/timstephenson/.rvm/gems/ruby-1.9.2-p180@global/gems/rake-0.9.2/lib/rake/application.rb:90:in `block (2 levels) in top_level'
/Users/timstephenson/.rvm/gems/ruby-1.9.2-p180@global/gems/rake-0.9.2/lib/rake/application.rb:90:in `each'
/Users/timstephenson/.rvm/gems/ruby-1.9.2-p180@global/gems/rake-0.9.2/lib/rake/application.rb:90:in `block in top_level'
/Users/timstephenson/.rvm/gems/ruby-1.9.2-p180@global/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/Users/timstephenson/.rvm/gems/ruby-1.9.2-p180@global/gems/rake-0.9.2/lib/rake/application.rb:84:in `top_level'
/Users/timstephenson/.rvm/gems/ruby-1.9.2-p180@global/gems/rake-0.9.2/lib/rake/application.rb:62:in `block in run'
/Users/timstephenson/.rvm/gems/ruby-1.9.2-p180@global/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/Users/timstephenson/.rvm/gems/ruby-1.9.2-p180@global/gems/rake-0.9.2/lib/rake/application.rb:59:in `run'
/Users/timstephenson/.rvm/gems/ruby-1.9.2-p180@global/gems/rake-0.9.2/bin/rake:32:in `<top (required)>'
/Users/timstephenson/.rvm/gems/ruby-1.9.2-p180@global/bin/rake:19:in `load'
/Users/timstephenson/.rvm/gems/ruby-1.9.2-p180@global/bin/rake:19:in `<main>'
Tasks: TOP => assets:precompile

Thanks in advance for any advice on how to resolve the issue. If it helps here's my ticket on heroku as well: https://support.heroku.com/requests/27952

Best

Tim

@spastorino spastorino closed this Jul 28, 2011
@spastorino spastorino reopened this Jul 28, 2011
@spastorino
Ruby on Rails member

Sorry for closing the ticket, github assignation of issues is working pretty bad

@spastorino
Ruby on Rails member

@timstephenson I need more information in order to reproduce the issue. Can you share with us a minimal app which reproduces the issue?

@timstephenson

Hi

Thanks for your help. Sorry I didn't get back to you sooner, I've been out of town since thursday. I just added you as a collaborator on the project in Github. It is a new project that we've just begun work on, so it is still small.

https://github.com/timstephenson/MosaicDS

Let me know if there is anything else that I can do.

Best

Tim

@spastorino
Ruby on Rails member

@timstephenson the wrong thing in you app is that you're doing //= require_tree ./application and application directory is not checked in.

Anyways the error could be better :)

@spastorino
Ruby on Rails member

I've added an issue on sprockets sstephenson/sprockets#141

@spastorino spastorino closed this Aug 3, 2011
@timstephenson

Thank you very much. I didn't notice that the empty directory didn't get added to the repo. I feel a little dumb.

Anyway, it is working now. Best

Tim

@spastorino spastorino referenced this issue in sstephenson/sprockets Jan 9, 2014
Closed

Provide a better error message ... #141

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment