资产:预编译在Rails 3.2.15上使用Asset Pipeline“File exists”失败

时间:2013-11-06 15:10:41

标签: ruby-on-rails ruby-on-rails-3 asset-pipeline sprockets

我无法为我的Rails 3.2.15资产管道启用应用程序预编译我的资产。

的Gemfile:

# Asset pipeline
group :assets do
  gem 'sass-rails',   '3.2.5'
  gem 'coffee-rails', '3.2.2'
  gem 'uglifier',     '1.3.0'
end

production.rb

  # Disable Rails's static asset server (Apache or nginx will already do this)
  config.serve_static_assets = false

  # Compress JavaScripts and CSS
  config.assets.compress = true

  # Don't fallback to assets pipeline if a precompiled asset is missed
  config.assets.compile = false

  # Generate digests for assets URLs
  config.assets.digest = true

  # Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
  config.assets.precompile += %w( *.js *.css )

  # Choose which compressors to use
  # config.assets.js_compressor  = :uglifier
  # config.assets.css_compressor = :scss

这些是我运行的命令:

bundle exec rake assets:clean RAILS_ENV=production --trace
bundle exec rake assets:precompile RAILS_ENV=production --trace

我收到以下错误:

** Invoke assets:precompile (first_time)
** Execute assets:precompile
/usr/bin/ruby1.9.1 /usr/local/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!
File exists - (/media/shared/code/me/app/tmp/cache/assets/sprockets%2F19d4dbfec65d2b21144310264f4d8c7320131106-63076-sh3p6h, /media/shared/code/me/app/tmp/cache/assets/D04/B00/sprockets%2F19d4dbfec65d2b21144310264f4d8c73)
/usr/lib/ruby/1.9.1/fileutils.rb:519:in `rename'
/usr/lib/ruby/1.9.1/fileutils.rb:519:in `block in mv'
/usr/lib/ruby/1.9.1/fileutils.rb:1515:in `block in fu_each_src_dest'
/usr/lib/ruby/1.9.1/fileutils.rb:1531:in `fu_each_src_dest0'
/usr/lib/ruby/1.9.1/fileutils.rb:1513:in `fu_each_src_dest'
/usr/lib/ruby/1.9.1/fileutils.rb:508:in `mv'
/usr/lib/ruby/gems/1.9.1/gems/activesupport-3.2.15/lib/active_support/core_ext/file/atomic.rb:36:in `atomic_write'

只有后一个文件(每次运行命令时似乎都会改变)在磁盘上可见,前者似乎是一个创建然后移动的临时文件。看到错误后看不见。

任何想法究竟是什么意思?

我正在运行Ubuntu 12.04.3 LTS,Rubygems 2.1.6,Bundler 1.3.5和Ruby 1.9.3p429

由于

0 个答案:

没有答案