Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

rake assets:precompile undefined method directory? for nil:NilClass

While trying to do an assets:precompile for a production website I've encountered this error for the first time.

 rake assets:precompile undefined method directory? for nil:NilClass

I have successfully updated the website and done a assets:precompile many times before.

The full example:

# RAILS_ENV=production rake assets:precompile --trace                        
/usr/local/rvm/gems/ruby-1.9.2-p290@pm/gems/rack-1.3.4/lib/rack/backports/uri/common_192.rb:53: warning: already initialized constant WFKV_
** Invoke assets:precompile (first_time)
** Execute assets:precompile
/usr/local/rvm/gems/ruby-1.9.2-p290@pm/gems/rack-1.3.4/lib/rack/backports/uri/common_192.rb:53: warning: already initialized constant WFKV_
rake aborted!
undefined method `directory?' for nil:NilClass

Tasks: TOP => assets:precompile
(See full trace by running task with --trace)

I'm looking forward to someone's insight in this one, I've been racking my brain and Googling answers for hours.

like image 483
Russ Petersen Avatar asked Nov 07 '11 19:11

Russ Petersen


1 Answers

This is what happens when the file system can't find one of the assets it thinks its supposed to precompile. This happened to me when my VM could not find one of the files in my shared folder (Weird VMware issue where it appeared in the directory listing but the file did not actually exist)

like image 138
Jamie Quint Avatar answered Nov 15 '22 15:11

Jamie Quint