assets:precompile - 权限被拒绝 - 仅在一台计算机上

时间:2012-10-24 19:00:24

标签: ruby-on-rails-3 tinymce asset-pipeline precompile

我有一个rails app项目文件夹,它位于我的Dropbox文件夹中。

我在2台电脑上工作 - 家用电脑和笔记本电脑(均赢得7台)

如果我在电脑上bundle exec rake assets:precompile,它工作正常,我看到了

C:/Ruby193/bin/ruby.exe C:/Ruby193/bin/rake assets:precompile:all RAILS_ENV=production RAILS_GROUPS=assets
mkdir -p H:/My Dropbox/project/public/assets
cp -r C:/Ruby193/lib/ruby/gems/1.9.1/gems/tinymce-rails-3.5.7.1/vendor/assets/javascripts/tinymce H:/My Dropbox/project/public/assets

但在笔记本电脑上,我在其中一个tinymce文件上被拒绝,并且预编译失败了..

app文件夹对每个人都有权限.. 任何想法为什么会发生这种情况?

更新

它似乎随机停止在文件上..不一定是tinymce。 我已经将所有ruby文件和项目文件设置为对每个人都有权限(win 7)并将所有只读的内容设置为不是。

这非常令人沮丧

--trace输出的示例。请注意,每次我运行资产时:预编译它停在不同的文件。这次它停在我的一个图标上

H:\My Dropbox\project>bundle exec rake assets:precompile --trace
** Invoke assets:precompile (first_time)
** Execute assets:precompile
C:/Ruby193/bin/ruby.exe C:/Ruby193/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 tmp:cache:clear (first_time)
** Execute tmp:cache:clear
** Execute assets:precompile:primary
rake aborted!
Permission denied - H:/My Dropbox/project/public/assets/Icons/ArrowDown-335eb652931bdc13061ad1745a25556f.jpg
C:/Ruby193/lib/ruby/gems/1.9.1/gems/sprockets-2.1.3/lib/sprockets/static_asset.rb:47:in `utime'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/sprockets-2.1.3/lib/sprockets/static_asset.rb:47:in `write_to'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/actionpack-3.2.8/lib/sprockets/static_compiler.rb:41:in `block in write_asset'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/actionpack-3.2.8/lib/sprockets/static_compiler.rb:38:in `tap'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/actionpack-3.2.8/lib/sprockets/static_compiler.rb:38:in `write_asset'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/actionpack-3.2.8/lib/sprockets/static_compiler.rb:24:in `block in compile'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/sprockets-2.1.3/lib/sprockets/base.rb:212:in `block in each_logical_path'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/sprockets-2.1.3/lib/sprockets/base.rb:200:in `block (2 levels) in each_file'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/sprockets-2.1.3/lib/sprockets/base.rb:190:in `each'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/sprockets-2.1.3/lib/sprockets/base.rb:190:in `each_entry'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/sprockets-2.1.3/lib/sprockets/base.rb:198:in `block in each_file'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/sprockets-2.1.3/lib/sprockets/base.rb:197:in `each'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/sprockets-2.1.3/lib/sprockets/base.rb:197:in `each_file'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/sprockets-2.1.3/lib/sprockets/base.rb:210:in `each_logical_path'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/actionpack-3.2.8/lib/sprockets/static_compiler.rb:18:in `compile'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/actionpack-3.2.8/lib/sprockets/assets.rake:56:in `internal_precompile'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/actionpack-3.2.8/lib/sprockets/assets.rake:70:in `block (3 levels) in <top (required)>'
C:/Ruby193/lib/ruby/1.9.1/rake/task.rb:205:in `call'
C:/Ruby193/lib/ruby/1.9.1/rake/task.rb:205:in `block in execute'
C:/Ruby193/lib/ruby/1.9.1/rake/task.rb:200:in `each'
C:/Ruby193/lib/ruby/1.9.1/rake/task.rb:200:in `execute'
C:/Ruby193/lib/ruby/1.9.1/rake/task.rb:158:in `block in invoke_with_call_chain'
C:/Ruby193/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
C:/Ruby193/lib/ruby/1.9.1/rake/task.rb:151:in `invoke_with_call_chain'
C:/Ruby193/lib/ruby/1.9.1/rake/task.rb:144:in `invoke'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/actionpack-3.2.8/lib/sprockets/assets.rake:60:in `block (3 levels) in <top (required)>'
C:/Ruby193/lib/ruby/1.9.1/rake/task.rb:205:in `call'
C:/Ruby193/lib/ruby/1.9.1/rake/task.rb:205:in `block in execute'
C:/Ruby193/lib/ruby/1.9.1/rake/task.rb:200:in `each'
C:/Ruby193/lib/ruby/1.9.1/rake/task.rb:200:in `execute'
C:/Ruby193/lib/ruby/1.9.1/rake/task.rb:158:in `block in invoke_with_call_chain'
C:/Ruby193/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
C:/Ruby193/lib/ruby/1.9.1/rake/task.rb:151:in `invoke_with_call_chain'
C:/Ruby193/lib/ruby/1.9.1/rake/task.rb:144:in `invoke'
C:/Ruby193/lib/ruby/1.9.1/rake/application.rb:116:in `invoke_task'
C:/Ruby193/lib/ruby/1.9.1/rake/application.rb:94:in `block (2 levels) in top_level'
C:/Ruby193/lib/ruby/1.9.1/rake/application.rb:94:in `each'
C:/Ruby193/lib/ruby/1.9.1/rake/application.rb:94:in `block in top_level'
C:/Ruby193/lib/ruby/1.9.1/rake/application.rb:133:in `standard_exception_handling'
C:/Ruby193/lib/ruby/1.9.1/rake/application.rb:88:in `top_level'
C:/Ruby193/lib/ruby/1.9.1/rake/application.rb:66:in `block in run'
C:/Ruby193/lib/ruby/1.9.1/rake/application.rb:133:in `standard_exception_handling'
C:/Ruby193/lib/ruby/1.9.1/rake/application.rb:63:in `run'
C:/Ruby193/bin/rake:32:in `<main>'
Tasks: TOP => assets:precompile:primary
rake aborted!
Command failed with status (1): [C:/Ruby193/bin/ruby.exe C:/Ruby193/bin/rak...]
C:/Ruby193/lib/ruby/1.9.1/rake/file_utils.rb:53:in `block in create_shell_runner'
C:/Ruby193/lib/ruby/1.9.1/rake/file_utils.rb:45:in `call'
C:/Ruby193/lib/ruby/1.9.1/rake/file_utils.rb:45:in `sh'
C:/Ruby193/lib/ruby/1.9.1/rake/file_utils_ext.rb:39:in `sh'
C:/Ruby193/lib/ruby/1.9.1/rake/file_utils.rb:80:in `ruby'
C:/Ruby193/lib/ruby/1.9.1/rake/file_utils_ext.rb:39:in `ruby'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/actionpack-3.2.8/lib/sprockets/assets.rake:12:in `ruby_rake_task'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/actionpack-3.2.8/lib/sprockets/assets.rake:21:in `invoke_or_reboot_rake_task'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/actionpack-3.2.8/lib/sprockets/assets.rake:29:in `block (2 levels) in <top (required)>'
C:/Ruby193/lib/ruby/1.9.1/rake/task.rb:205:in `call'
C:/Ruby193/lib/ruby/1.9.1/rake/task.rb:205:in `block in execute'
C:/Ruby193/lib/ruby/1.9.1/rake/task.rb:200:in `each'
C:/Ruby193/lib/ruby/1.9.1/rake/task.rb:200:in `execute'
C:/Ruby193/lib/ruby/1.9.1/rake/task.rb:158:in `block in invoke_with_call_chain'
C:/Ruby193/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
C:/Ruby193/lib/ruby/1.9.1/rake/task.rb:151:in `invoke_with_call_chain'
C:/Ruby193/lib/ruby/1.9.1/rake/task.rb:144:in `invoke'
C:/Ruby193/lib/ruby/1.9.1/rake/application.rb:116:in `invoke_task'
C:/Ruby193/lib/ruby/1.9.1/rake/application.rb:94:in `block (2 levels) in top_level'
C:/Ruby193/lib/ruby/1.9.1/rake/application.rb:94:in `each'
C:/Ruby193/lib/ruby/1.9.1/rake/application.rb:94:in `block in top_level'
C:/Ruby193/lib/ruby/1.9.1/rake/application.rb:133:in `standard_exception_handling'
C:/Ruby193/lib/ruby/1.9.1/rake/application.rb:88:in `top_level'
C:/Ruby193/lib/ruby/1.9.1/rake/application.rb:66:in `block in run'
C:/Ruby193/lib/ruby/1.9.1/rake/application.rb:133:in `standard_exception_handling'
C:/Ruby193/lib/ruby/1.9.1/rake/application.rb:63:in `run'
C:/Ruby193/bin/rake:32:in `<main>'
Tasks: TOP => assets:precompile

2 个答案:

答案 0 :(得分:1)

首先消除可能存在的问题。

首先,从等式中删除DropBox。检查并在本地硬盘上编译。

其次,确保TinyMCE在您的Gemfile中并使用bundler安装。你的项目不应该从全球宝石中提取宝石,而应该是项目特定的捆绑宝石。

如果失败,您需要遵循Digital Cake的建议并向我们提供--trace输出。

答案 1 :(得分:0)

这是猜测,但我认为该权限是因为tmp折叠用于临时存储文件,因为它们是预编译的。 a --trace应该为您提供更好的错误日志,这对于确定错误发生的位置至关重要。