assets:precompile - permission denied - only on one computer

穿精又带淫゛_ 提交于 2020-01-04 04:43:05

问题


I have a rails app project folder which is on my dropbox folder.

I work on 2 computers - home pc and a laptop (both win 7)

If I do bundle exec rake assets:precompile on the pc it works fine and I see the line

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

but on the laptop I get persmission denied on one of the tinymce files and the precompilation fails..

the app folder has permissions for everyone.. Any ideas why this could happen?

Update:

It seems it stops on files randomly.. not necessarily tinymce. I've set all ruby files and project file to have permissions to everyone (win 7) and set all that was read only to not be that.

this is very frustrating

an example of a --trace output. note that everytime I run assets:precompile it stops at a different file. this time it stopped on one of my icons

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

回答1:


Start by eliminating possible problems.

First, remove DropBox from the equation. Check out and compile on a local hard drive.

Second, make sure TinyMCE is in your Gemfile and installed with bundler. Your project shouldn't be pulling gems from the global gems but project specific, bundled gems.

If that fails, you'll need to follow Digital Cake's advice and provide us with a --trace output.




回答2:


This is a guess but I would think that the permission is because of a tmp fold used to temporarily store the files as they are pre compiled. a --trace should give you better error logs and that would be key to figuring out where the error is happening.



来源:https://stackoverflow.com/questions/13055922/assetsprecompile-permission-denied-only-on-one-computer

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!