2012-03-02 114 views
-1

預編譯入資產價值與RAILS_ENV=production rake assets:precompile了錯誤,如:資產預編譯工作不

rake aborted! 
undefined method `empty?' for #<File:0xc1339e8> 

堆棧跟蹤:

DEPRECATION WARNING: The InstanceMethods module inside ActiveSupport::Concern will be no longer included automatically. Please define instance methods directly in ActionView::Base instead. (called from require at /usr/local/rvm/gems/[email protected]/gems/bundler-1.0.22/lib/bundler/runtime.rb:68) 
DEPRECATION WARNING: The InstanceMethods module inside ActiveSupport::Concern will be no longer included automatically. Please define instance methods directly in ThemesForRails::AssetsController instead. (called from require at /usr/local/rvm/gems/[email protected]/gems/bundler-1.0.22/lib/bundler/runtime.rb:68) 
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 require at /usr/local/rvm/gems/[email protected]/gems/bundler-1.0.22/lib/bundler/runtime.rb:68) 
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 require at /usr/local/rvm/gems/[email protected]/gems/bundler-1.0.22/lib/bundler/runtime.rb:68) 
DEPRECATION WARNING: The InstanceMethods module inside ActiveSupport::Concern will be no longer included automatically. Please define instance methods directly in ActionMailer::Base instead. (called from require at /usr/local/rvm/gems/[email protected]/gems/bundler-1.0.22/lib/bundler/runtime.rb:68) 
DEPRECATION WARNING: The InstanceMethods module inside ActiveSupport::Concern will be no longer included automatically. Please define instance methods directly in ActionMailer::Base instead. (called from require at /usr/local/rvm/gems/[email protected]/gems/bundler-1.0.22/lib/bundler/runtime.rb:68) 
DEPRECATION WARNING: The InstanceMethods module inside ActiveSupport::Concern will be no longer included automatically. Please define instance methods directly in ActionMailer::Base instead. (called from require at /usr/local/rvm/gems/[email protected]/gems/bundler-1.0.22/lib/bundler/runtime.rb:68) 
** Invoke assets:precompile (first_time) 
** Execute assets:precompile 
/usr/local/rvm/rubies/ruby-1.9.3-p125-perf/bin/ruby /usr/local/rvm/gems/[email protected]/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 ActionView::Base instead. (called from require at /usr/local/rvm/gems/[email protected]/gems/bundler-1.0.22/lib/bundler/runtime.rb:68) 
DEPRECATION WARNING: The InstanceMethods module inside ActiveSupport::Concern will be no longer included automatically. Please define instance methods directly in ThemesForRails::AssetsController instead. (called from require at /usr/local/rvm/gems/[email protected]/gems/bundler-1.0.22/lib/bundler/runtime.rb:68) 
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 require at /usr/local/rvm/gems/[email protected]/gems/bundler-1.0.22/lib/bundler/runtime.rb:68) 
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 require at /usr/local/rvm/gems/[email protected]/gems/bundler-1.0.22/lib/bundler/runtime.rb:68) 
DEPRECATION WARNING: The InstanceMethods module inside ActiveSupport::Concern will be no longer included automatically. Please define instance methods directly in ActionMailer::Base instead. (called from require at /usr/local/rvm/gems/[email protected]/gems/bundler-1.0.22/lib/bundler/runtime.rb:68) 
DEPRECATION WARNING: The InstanceMethods module inside ActiveSupport::Concern will be no longer included automatically. Please define instance methods directly in ActionMailer::Base instead. (called from require at /usr/local/rvm/gems/[email protected]/gems/bundler-1.0.22/lib/bundler/runtime.rb:68) 
DEPRECATION WARNING: The InstanceMethods module inside ActiveSupport::Concern will be no longer included automatically. Please define instance methods directly in ActionMailer::Base instead. (called from require at /usr/local/rvm/gems/[email protected]/gems/bundler-1.0.22/lib/bundler/runtime.rb:68) 
** 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 tmp:cache:clear (first_time) 
** Execute tmp:cache:clear 
** Execute assets:precompile:primary 
DEPRECATION WARNING: The InstanceMethods module inside ActiveSupport::Concern will be no longer included automatically. Please define instance methods directly in ActionView::Base instead. (called from require at /usr/local/rvm/gems/[email protected]/gems/bundler-1.0.22/lib/bundler/runtime.rb:68) 
DEPRECATION WARNING: The InstanceMethods module inside ActiveSupport::Concern will be no longer included automatically. Please define instance methods directly in ThemesForRails::AssetsController instead. (called from require at /usr/local/rvm/gems/[email protected]/gems/bundler-1.0.22/lib/bundler/runtime.rb:68) 
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 require at /usr/local/rvm/gems/[email protected]/gems/bundler-1.0.22/lib/bundler/runtime.rb:68) 
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 require at /usr/local/rvm/gems/[email protected]/gems/bundler-1.0.22/lib/bundler/runtime.rb:68) 
DEPRECATION WARNING: The InstanceMethods module inside ActiveSupport::Concern will be no longer included automatically. Please define instance methods directly in ActionMailer::Base instead. (called from require at /usr/local/rvm/gems/[email protected]/gems/bundler-1.0.22/lib/bundler/runtime.rb:68) 
DEPRECATION WARNING: The InstanceMethods module inside ActiveSupport::Concern will be no longer included automatically. Please define instance methods directly in ActionMailer::Base instead. (called from require at /usr/local/rvm/gems/[email protected]/gems/bundler-1.0.22/lib/bundler/runtime.rb:68) 
DEPRECATION WARNING: The InstanceMethods module inside ActiveSupport::Concern will be no longer included automatically. Please define instance methods directly in ActionMailer::Base instead. (called from require at /usr/local/rvm/gems/[email protected]/gems/bundler-1.0.22/lib/bundler/runtime.rb:68) 
** Invoke assets:precompile:nondigest (first_time) 
** Invoke assets:environment (first_time) 
** Execute assets:environment 
** Invoke tmp:cache:clear (first_time) 
** Execute tmp:cache:clear 
** Execute assets:precompile:nondigest 
** Invoke assets:environment (first_time) 
** Execute assets:environment 
Using: Directory Search of /home/roo/Documents/RubyApplications/REALVOLVE/Realvolve-28-Feb/public/assets 
Uploading: assets/application-08d5bf8b6880620e6c8aad0f7ffbe7c2.css.gz 
rake aborted! 
undefined method `empty?' for #<File:0xc1339e8> 
/usr/local/rvm/gems/[email protected]/gems/excon-0.10.0/lib/excon/connection.rb:211:in `request_kernel' 
/usr/local/rvm/gems/[email protected]/gems/excon-0.10.0/lib/excon/connection.rb:92:in `request' 
/usr/local/rvm/gems/[email protected]/gems/fog-0.7.2/lib/fog/core/connection.rb:20:in `request' 
/usr/local/rvm/gems/[email protected]/gems/fog-0.7.2/lib/fog/storage/aws.rb:323:in `request' 
/usr/local/rvm/gems/[email protected]/gems/fog-0.7.2/lib/fog/storage/requests/aws/put_object.rb:43:in `put_object' 
/usr/local/rvm/gems/[email protected]/gems/fog-0.7.2/lib/fog/storage/models/aws/file.rb:119:in `save' 
/usr/local/rvm/gems/[email protected]/gems/fog-0.7.2/lib/fog/core/collection.rb:50:in `create' 
/usr/local/rvm/gems/[email protected]/gems/asset_sync-0.2.10/lib/asset_sync/storage.rb:117:in `upload_file' 
/usr/local/rvm/gems/[email protected]/gems/asset_sync-0.2.10/lib/asset_sync/storage.rb:129:in `block in upload_files' 
/usr/local/rvm/gems/[email protected]/gems/asset_sync-0.2.10/lib/asset_sync/storage.rb:127:in `each' 
/usr/local/rvm/gems/[email protected]/gems/asset_sync-0.2.10/lib/asset_sync/storage.rb:127:in `upload_files' 
/usr/local/rvm/gems/[email protected]/gems/asset_sync-0.2.10/lib/asset_sync/storage.rb:135:in `sync' 
/usr/local/rvm/gems/[email protected]/gems/asset_sync-0.2.10/lib/asset_sync/asset_sync.rb:29:in `sync' 
/usr/local/rvm/gems/[email protected]/gems/asset_sync-0.2.10/lib/tasks/asset_sync.rake:14:in `block in <top (required)>' 
/usr/local/rvm/gems/[email protected]/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call' 
/usr/local/rvm/gems/[email protected]/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `block in execute' 
/usr/local/rvm/gems/[email protected]/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each' 
/usr/local/rvm/gems/[email protected]/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute' 
/usr/local/rvm/gems/[email protected]/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain' 
/usr/local/rvm/rubies/ruby-1.9.3-p125-perf/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize' 
/usr/local/rvm/gems/[email protected]/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain' 
/usr/local/rvm/gems/[email protected]/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke' 
/usr/local/rvm/gems/[email protected]/gems/rake-0.9.2.2/lib/rake/application.rb:116:in `invoke_task' 
/usr/local/rvm/gems/[email protected]/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block (2 levels) in top_level' 
/usr/local/rvm/gems/[email protected]/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `each' 
/usr/local/rvm/gems/[email protected]/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block in top_level' 
/usr/local/rvm/gems/[email protected]/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling' 
/usr/local/rvm/gems/[email protected]/gems/rake-0.9.2.2/lib/rake/application.rb:88:in `top_level' 
/usr/local/rvm/gems/[email protected]/gems/rake-0.9.2.2/lib/rake/application.rb:66:in `block in run' 
/usr/local/rvm/gems/[email protected]/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling' 
/usr/local/rvm/gems/[email protected]/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run' 
/usr/local/rvm/gems/[email protected]/gems/rake-0.9.2.2/bin/rake:33:in `<top (required)>' 
/usr/local/rvm/gems/[email protected]/bin/rake:19:in `load' 
/usr/local/rvm/gems/[email protected]/bin/rake:19:in `<main>' 
Tasks: TOP => assets:precompile 
+0

在這裏可以得到一些上下文嗎?什麼是造成棄用警告?你可以發佈給它的代碼/代碼文件嗎? – ScottJShea 2012-03-03 00:15:28

回答

0

感謝所有。

我試過「bundle exec rake assets:clean assets:precompile」,但仍然是同樣的問題。

另外asset_sync不是問題。

我發現axcon gem版本「0.10.0」導致了這個問題。所以我將版本限制爲「0.9.5」。它爲我工作。

0

只是一種嘗試......

對於較新的Rails版本,你不不必再包括環境。嘗試使用

bundle exec rake assets:clean assets:precompile 
  • 確保耙的正確版本使用。
  • 確保資產在再次編譯之前已經清理完畢。
0

這看起來與asset_sync不是Heroku或rake assets:precompile任務有關。

我們開發asset_sync所以也許我可以幫忙。我建議你嘗試以下方法:

  • 確保您的asset_sync配置是正確的
  • 更新asset_sync最新副本。 版本0.3.0
  • 清空您的S3資產鬥

如果沒有這樣的作品,請張貼在Github上的問題,我們會考慮這個問題進一步爲您服務。我們還沒有這樣的報告,因此我們可能需要查看匿名版本的應用,以嘗試複製該問題。

你也可以詢問Heroku支持尋求類似問題的幫助。