{"comment":{"created_at":"2011-10-24T14:27:17Z","body":"Yes - using 0.7.5. I am on a Windows 7 host and NTFS partition.  I think the problem is that `lock_file` **is** locking the file, since running on linux, but the underlying file is managed by Windows, so there is some conflict related to the lock. Will look around, this has got to be a common issue, not only in ruby.","updated_at":"2011-10-24T14:27:17Z","url":"https://api.github.com/repos/dougal/acts_as_indexed/issues/comments/2504052","id":2504052,"user":{"avatar_url":"https://secure.gravatar.com/avatar/402d0dde7b92796365d0d52c87f728e4?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"402d0dde7b92796365d0d52c87f728e4","url":"https://api.github.com/users/ericgj","id":291002,"login":"ericgj"}},"action":"created","issue":{"number":15,"created_at":"2011-07-09T01:40:59Z","pull_request":{"diff_url":null,"patch_url":null,"html_url":null},"body":"We're creating a development environment deployment that utilizes Refinery CMS (which, in turn, uses acts_as_indexed). Deployment is happening using vagrant & VirtualBox. Everything seems to go well when we deploy on Mac OS X, but we're seeing an issue during deployment on Windows. During the execution of db:migrate on the Ubuntu VM, deployment fails because a file cannot be renamed (moved) on the mount to the Windows share that holds the git checkout for the project. \r\n\r\nFull stacktrace is below, but the relevant bit:` Operation not permitted - (/srv/enmasse-online/current/index/development/ \r\nRefinerySetting/100_114_97.ind.tmp, /srv/enmasse-online/current/index/ development/RefinerySetting/100_114_97.ind)` \r\n\r\nWhen I run the mv outside of rake on the Ubuntu VM (`mv 100_114_97.ind.tmp 100_114_97.ind`), the file is moved properly. I made the directory on the Windows box world writable and the issue was not resolved. \r\n\r\nWhat is act_as_indexed trying to do during the db:migrate that would work on a unix-based system but encounter issues on a unix-based system trying to move a file on a Windows mount?\r\n\r\nReference: http://groups.google.com/group/refinery-cms/browse_thread/thread/3f19f1c7ae5bbeee\r\n\r\nStack trace & manual move of the file below:\r\n\r\n<code>vagrant@lucid64:/srv/enmasse-online/current$ bundle exec rake db:migrate --trace\r\n** Invoke db:migrate (first_time)\r\n** Invoke environment (first_time)\r\n** Execute environment\r\nrake aborted!\r\nOperation not permitted - (/srv/enmasse-online/current/index/development/RefinerySetting/100_114_97.ind.tmp, /srv/enmasse-online/current/index/development/RefinerySetting/100_114_97.ind)\r\n/usr/local/rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/fileutils.rb:515:in `rename'\r\n/usr/local/rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/fileutils.rb:515:in `block in mv'\r\n/usr/local/rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/fileutils.rb:1423:in `block in fu_each_src_dest'\r\n/usr/local/rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/fileutils.rb:1439:in `fu_each_src_dest0'\r\n/usr/local/rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/fileutils.rb:1421:in `fu_each_src_dest'\r\n/usr/local/rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/fileutils.rb:504:in `mv'\r\n/usr/local/rvm/gems/ruby-1.9.2-p180@enmasse_online/gems/acts_as_indexed-0.7.2/lib/acts_as_indexed/storage.rb:164:in `write_file'\r\n/usr/local/rvm/gems/ruby-1.9.2-p180@enmasse_online/gems/acts_as_indexed-0.7.2/lib/acts_as_indexed/storage.rb:95:in `block (2 levels) in operate'\r\n/usr/local/rvm/gems/ruby-1.9.2-p180@enmasse_online/gems/acts_as_indexed-0.7.2/lib/acts_as_indexed/storage.rb:175:in `block in lock_file'\r\n/usr/local/rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/pathname.rb:829:in `open'\r\n/usr/local/rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/pathname.rb:829:in `open'\r\n/usr/local/rvm/gems/ruby-1.9.2-p180@enmasse_online/gems/acts_as_indexed-0.7.2/lib/acts_as_indexed/storage.rb:172:in `lock_file'\r\n/usr/local/rvm/gems/ruby-1.9.2-p180@enmasse_online/gems/acts_as_indexed-0.7.2/lib/acts_as_indexed/storage.rb:83:in `block in operate'\r\n/usr/local/rvm/gems/ruby-1.9.2-p180@enmasse_online/gems/acts_as_indexed-0.7.2/lib/acts_as_indexed/storage.rb:80:in `each'\r\n/usr/local/rvm/gems/ruby-1.9.2-p180@enmasse_online/gems/acts_as_indexed-0.7.2/lib/acts_as_indexed/storage.rb:80:in `operate'\r\n/usr/local/rvm/gems/ruby-1.9.2-p180@enmasse_online/gems/acts_as_indexed-0.7.2/lib/acts_as_indexed/storage.rb:23:in `add'\r\n/usr/local/rvm/gems/ruby-1.9.2-p180@enmasse_online/gems/acts_as_indexed-0.7.2/lib/acts_as_indexed/search_index.rb:28:in `add_record'\r\n/usr/local/rvm/gems/ruby-1.9.2-p180@enmasse_online/gems/acts_as_indexed-0.7.2/lib/acts_as_indexed/class_methods.rb:65:in `index_add'\r\n/usr/local/rvm/gems/ruby-1.9.2-p180@enmasse_online/gems/acts_as_indexed-0.7.2/lib/acts_as_indexed/instance_methods.rb:16:in `add_to_index'\r\n/usr/local/rvm/gems/ruby-1.9.2-p180@enmasse_online/gems/activesupport-3.0.9/lib/active_support/callbacks.rb:416:in `_run_create_callbacks'\r\n/usr/local/rvm/gems/ruby-1.9.2-p180@enmasse_online/gems/activerecord-3.0.9/lib/active_record/callbacks.rb:277:in `create'\r\n/usr/local/rvm/gems/ruby-1.9.2-p180@enmasse_online/gems/activerecord-3.0.9/lib/active_record/persistence.rb:250:in `create_or_update'\r\n/usr/local/rvm/gems/ruby-1.9.2-p180@enmasse_online/gems/activerecord-3.0.9/lib/active_record/callbacks.rb:273:in `block in create_or_update'\r\n/usr/local/rvm/gems/ruby-1.9.2-p180@enmasse_online/gems/activesupport-3.0.9/lib/active_support/callbacks.rb:419:in `_run_save_callbacks'\r\n/usr/local/rvm/gems/ruby-1.9.2-p180@enmasse_online/gems/activerecord-3.0.9/lib/active_record/callbacks.rb:273:in `create_or_update'\r\n/usr/local/rvm/gems/ruby-1.9.2-p180@enmasse_online/gems/activerecord-3.0.9/lib/active_record/persistence.rb:40:in `save'\r\n/usr/local/rvm/gems/ruby-1.9.2-p180@enmasse_online/gems/activerecord-3.0.9/lib/active_record/validations.rb:43:in `save'\r\n/usr/local/rvm/gems/ruby-1.9.2-p180@enmasse_online/gems/activerecord-3.0.9/lib/active_record/attribute_methods/dirty.rb:21:in `save'\r\n/usr/local/rvm/gems/ruby-1.9.2-p180@enmasse_online/gems/activerecord-3.0.9/lib/active_record/transactions.rb:240:in `block (2 levels) in save'\r\n/usr/local/rvm/gems/ruby-1.9.2-p180@enmasse_online/gems/activerecord-3.0.9/lib/active_record/transactions.rb:292:in `block in with_transaction_returning_status'\r\n/usr/local/rvm/gems/ruby-1.9.2-p180@enmasse_online/gems/activerecord-3.0.9/lib/active_record/connection_adapters/abstract/database_statements.rb:139:in `transaction'\r\n/usr/local/rvm/gems/ruby-1.9.2-p180@enmasse_online/gems/activerecord-3.0.9/lib/active_record/transactions.rb:207:in `transaction'\r\n/usr/local/rvm/gems/ruby-1.9.2-p180@enmasse_online/gems/activerecord-3.0.9/lib/active_record/transactions.rb:290:in `with_transaction_returning_status'\r\n/usr/local/rvm/gems/ruby-1.9.2-p180@enmasse_online/gems/activerecord-3.0.9/lib/active_record/transactions.rb:240:in `block in save'\r\n/usr/local/rvm/gems/ruby-1.9.2-p180@enmasse_online/gems/activerecord-3.0.9/lib/active_record/transactions.rb:251:in `rollback_active_record_state!'\r\n/usr/local/rvm/gems/ruby-1.9.2-p180@enmasse_online/gems/activerecord-3.0.9/lib/active_record/transactions.rb:239:in `save'\r\n/usr/local/rvm/gems/ruby-1.9.2-p180@enmasse_online/gems/refinerycms-settings-0.9.9.22/app/models/refinery_setting.rb:133:in `set'\r\n/usr/local/rvm/gems/ruby-1.9.2-p180@enmasse_online/gems/refinerycms-settings-0.9.9.22/app/models/refinery_setting.rb:98:in `find_or_set'\r\n/srv/enmasse-online/current/vendor/engines/refinerycms-images/lib/refinerycms-images.rb:35:in `block (2 levels) in <class:Engine>'\r\n/usr/local/rvm/gems/ruby-1.9.2-p180@enmasse_online/gems/dragonfly-0.9.4/lib/dragonfly/configurable.rb:35:in `configure'\r\n/usr/local/rvm/gems/ruby-1.9.2-p180@enmasse_online/gems/dragonfly-0.9.4/lib/dragonfly/configurable.rb:42:in `configure_with'\r\n/srv/enmasse-online/current/vendor/engines/refinerycms-images/lib/refinerycms-images.rb:26:in `block in <class:Engine>'\r\n/usr/local/rvm/gems/ruby-1.9.2-p180@enmasse_online/gems/railties-3.0.9/lib/rails/initializable.rb:25:in `instance_exec'\r\n/usr/local/rvm/gems/ruby-1.9.2-p180@enmasse_online/gems/railties-3.0.9/lib/rails/initializable.rb:25:in `run'\r\n/usr/local/rvm/gems/ruby-1.9.2-p180@enmasse_online/gems/railties-3.0.9/lib/rails/initializable.rb:50:in `block in run_initializers'\r\n/usr/local/rvm/gems/ruby-1.9.2-p180@enmasse_online/gems/railties-3.0.9/lib/rails/initializable.rb:49:in `each'\r\n/usr/local/rvm/gems/ruby-1.9.2-p180@enmasse_online/gems/railties-3.0.9/lib/rails/initializable.rb:49:in `run_initializers'\r\n/usr/local/rvm/gems/ruby-1.9.2-p180@enmasse_online/gems/railties-3.0.9/lib/rails/application.rb:134:in `initialize!'\r\n/usr/local/rvm/gems/ruby-1.9.2-p180@enmasse_online/gems/railties-3.0.9/lib/rails/application.rb:77:in `method_missing'\r\n/srv/enmasse-online/current/config/environment.rb:13:in `<top (required)>'\r\n/usr/local/rvm/gems/ruby-1.9.2-p180@enmasse_online/gems/activesupport-3.0.9/lib/active_support/dependencies.rb:239:in `require'\r\n/usr/local/rvm/gems/ruby-1.9.2-p180@enmasse_online/gems/activesupport-3.0.9/lib/active_support/dependencies.rb:239:in `block in require'\r\n/usr/local/rvm/gems/ruby-1.9.2-p180@enmasse_online/gems/activesupport-3.0.9/lib/active_support/dependencies.rb:225:in `block in load_dependency'\r\n/usr/local/rvm/gems/ruby-1.9.2-p180@enmasse_online/gems/activesupport-3.0.9/lib/active_support/dependencies.rb:596:in `new_constants_in'\r\n/usr/local/rvm/gems/ruby-1.9.2-p180@enmasse_online/gems/activesupport-3.0.9/lib/active_support/dependencies.rb:225:in `load_dependency'\r\n/usr/local/rvm/gems/ruby-1.9.2-p180@enmasse_online/gems/activesupport-3.0.9/lib/active_support/dependencies.rb:239:in `require'\r\n/usr/local/rvm/gems/ruby-1.9.2-p180@enmasse_online/gems/railties-3.0.9/lib/rails/application.rb:103:in `require_environment!'\r\n/usr/local/rvm/gems/ruby-1.9.2-p180@enmasse_online/gems/railties-3.0.9/lib/rails/application.rb:218:in `block in initialize_tasks'\r\n/usr/local/rvm/gems/ruby-1.9.2-p180@enmasse_online/gems/rake-0.9.2/lib/rake/task.rb:205:in `call'\r\n/usr/local/rvm/gems/ruby-1.9.2-p180@enmasse_online/gems/rake-0.9.2/lib/rake/task.rb:205:in `block in execute'\r\n/usr/local/rvm/gems/ruby-1.9.2-p180@enmasse_online/gems/rake-0.9.2/lib/rake/task.rb:200:in `each'\r\n/usr/local/rvm/gems/ruby-1.9.2-p180@enmasse_online/gems/rake-0.9.2/lib/rake/task.rb:200:in `execute'\r\n/usr/local/rvm/gems/ruby-1.9.2-p180@enmasse_online/gems/rake-0.9.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'\r\n/usr/local/rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'\r\n/usr/local/rvm/gems/ruby-1.9.2-p180@enmasse_online/gems/rake-0.9.2/lib/rake/task.rb:151:in `invoke_with_call_chain'\r\n/usr/local/rvm/gems/ruby-1.9.2-p180@enmasse_online/gems/rake-0.9.2/lib/rake/task.rb:176:in `block in invoke_prerequisites'\r\n/usr/local/rvm/gems/ruby-1.9.2-p180@enmasse_online/gems/rake-0.9.2/lib/rake/task.rb:174:in `each'\r\n/usr/local/rvm/gems/ruby-1.9.2-p180@enmasse_online/gems/rake-0.9.2/lib/rake/task.rb:174:in `invoke_prerequisites'\r\n/usr/local/rvm/gems/ruby-1.9.2-p180@enmasse_online/gems/rake-0.9.2/lib/rake/task.rb:157:in `block in invoke_with_call_chain'\r\n/usr/local/rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'\r\n/usr/local/rvm/gems/ruby-1.9.2-p180@enmasse_online/gems/rake-0.9.2/lib/rake/task.rb:151:in `invoke_with_call_chain'\r\n/usr/local/rvm/gems/ruby-1.9.2-p180@enmasse_online/gems/rake-0.9.2/lib/rake/task.rb:144:in `invoke'\r\n/usr/local/rvm/gems/ruby-1.9.2-p180@enmasse_online/gems/rake-0.9.2/lib/rake/application.rb:112:in `invoke_task'\r\n/usr/local/rvm/gems/ruby-1.9.2-p180@enmasse_online/gems/rake-0.9.2/lib/rake/application.rb:90:in `block (2 levels) in top_level'\r\n/usr/local/rvm/gems/ruby-1.9.2-p180@enmasse_online/gems/rake-0.9.2/lib/rake/application.rb:90:in `each'\r\n/usr/local/rvm/gems/ruby-1.9.2-p180@enmasse_online/gems/rake-0.9.2/lib/rake/application.rb:90:in `block in top_level'\r\n/usr/local/rvm/gems/ruby-1.9.2-p180@enmasse_online/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'\r\n/usr/local/rvm/gems/ruby-1.9.2-p180@enmasse_online/gems/rake-0.9.2/lib/rake/application.rb:84:in `top_level'\r\n/usr/local/rvm/gems/ruby-1.9.2-p180@enmasse_online/gems/rake-0.9.2/lib/rake/application.rb:62:in `block in run'\r\n/usr/local/rvm/gems/ruby-1.9.2-p180@enmasse_online/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'\r\n/usr/local/rvm/gems/ruby-1.9.2-p180@enmasse_online/gems/rake-0.9.2/lib/rake/application.rb:59:in `run'\r\n/usr/local/rvm/gems/ruby-1.9.2-p180@enmasse_online/gems/rake-0.9.2/bin/rake:32:in `<top (required)>'\r\n/usr/local/rvm/gems/ruby-1.9.2-p180@enmasse_online/bin/rake:19:in `load'\r\n/usr/local/rvm/gems/ruby-1.9.2-p180@enmasse_online/bin/rake:19:in `<main>'\r\nTasks: TOP => db:migrate => environment</code>\r\n\r\n<code>vagrant@lucid64:/srv/enmasse-online/current$ ls -la index/development/RefinerySetting/\r\ntotal 8\r\ndrwxrwxrwx 1 vagrant vagrant 4096 2011-07-09 03:37 .\r\ndrwxrwxrwx 1 vagrant vagrant    0 2011-07-06 01:22 ..\r\n-rwxrwxrwx 1 vagrant vagrant   99 2011-07-09 03:33 100_114_97.ind\r\n-rwxrwxrwx 1 vagrant vagrant  105 2011-07-09 03:38 100_114_97.ind.tmp\r\n-rwxrwxrwx 1 vagrant vagrant   78 2011-07-06 01:22 117_115_101.ind\r\n-rwxrwxrwx 1 vagrant vagrant   80 2011-07-06 01:22 117_115_101.ind.tmp\r\n-rwxrwxrwx 1 vagrant vagrant    1 2011-07-06 01:22 size\r\n-rwxrwxrwx 1 vagrant vagrant    1 2011-07-06 21:11 size.tmp\r\n-rwxrwxrwx 1 vagrant vagrant    5 2011-07-06 01:22 version\r\nvagrant@lucid64:/srv/enmasse-online/current$ mv index/development/RefinerySetting/100_114_97.ind.tmp index/development/RefinerySetting/100_114_97.ind\r\nvagrant@lucid64:/srv/enmasse-online/current$ ls -la index/development/RefinerySetting/\r\ntotal 7\r\ndrwxrwxrwx 1 vagrant vagrant 4096 2011-07-09 03:39 .\r\ndrwxrwxrwx 1 vagrant vagrant    0 2011-07-06 01:22 ..\r\n-rwxrwxrwx 1 vagrant vagrant  105 2011-07-09 03:38 100_114_97.ind\r\n-rwxrwxrwx 1 vagrant vagrant   78 2011-07-06 01:22 117_115_101.ind\r\n-rwxrwxrwx 1 vagrant vagrant   80 2011-07-06 01:22 117_115_101.ind.tmp\r\n-rwxrwxrwx 1 vagrant vagrant    1 2011-07-06 01:22 size\r\n-rwxrwxrwx 1 vagrant vagrant    1 2011-07-06 21:11 size.tmp\r\n-rwxrwxrwx 1 vagrant vagrant    5 2011-07-06 01:22 version\r\nvagrant@lucid64:/srv/enmasse-online/current$</code>","comments":7,"title":"Issue with db:migrate & acts_as_indexed files","updated_at":"2011-10-24T14:27:18Z","url":"https://api.github.com/repos/dougal/acts_as_indexed/issues/15","id":1193611,"assignee":null,"milestone":null,"closed_at":null,"user":{"avatar_url":"https://secure.gravatar.com/avatar/95590e6ddd860b51672be4259a126530?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"95590e6ddd860b51672be4259a126530","url":"https://api.github.com/users/syelle","id":889602,"login":"syelle"},"html_url":"https://github.com/dougal/acts_as_indexed/issues/15","labels":[],"state":"open"},"legacy":{"issue_id":1193611,"comment_id":2504052}}