clemens / expire_on_restart

A simple plugin to expire (cache) files on every server (re)start
http://www.railway.at
MIT License
1 stars 0 forks source link

Permission denied for delete on Windows #1

Open idev opened 15 years ago

idev commented 15 years ago

Yes i know Windows and Rails is not the best solution but we have to use it in our company. (We just use it for development I get the following Error:

c:...../vendor/plugins/expire_on_restart/lib/expire_on_restart.rb:21:in delete': Permission denied - C:/..../tmp/.expire_on_restart (Errno::EACCES) from C:/..../vendor/plugins/expire_on_restart/lib/expire_on_restart.rb:21:inexpire_marked_files' from C:/..../vendor/plugins/expire_on_restart/init.rb:7:in evaluate_init_rb' from c:/ruby/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/rails/plugin.rb:158:inevaluate_init_rb' from c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/core_ext/kernel/reporting.rb:11:in silence_warnings' from c:/ruby/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/rails/plugin.rb:154:inevaluate_init_rb' from c:/ruby/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/rails/plugin.rb:48:in load' from c:/ruby/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/rails/plugin/loader.rb:38:inload_plugins' from c:/ruby/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/rails/plugin/loader.rb:37:in each' ... 11 levels... from c:/ruby/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/commands/server.rb:84 from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:ingem_original_require' from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require' from script/server:3

idev commented 15 years ago

Workaround: init.rb unless RAILS_ENV == 'test' || RAILS_ENV == 'development

clemens commented 15 years ago

I've just changed the chmod of the file to 666 - i.e. it should be writable and readable for all. I have no idea whether or not this works in Windows - please do check it and get back to me in case it doesn't, so I can come up with a solution that might be less intrusive than your workaround based on the environment.