我无法为启用 Rails 3.2.15 资产管道的应用程序预编译资产。
宝石文件:
# Asset pipeline
group :assets do
gem 'sass-rails', '3.2.5'
gem 'coffee-rails', '3.2.2'
gem 'uglifier', '1.3.0'
end
生产.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
谢谢