Errno::ETXTBSY: Text file busy @ unlink_internal

后端 未结 2 2045
长发绾君心
长发绾君心 2021-01-12 15:18

The error:

Errno::ETXTBSY: Text file busy @ unlink_internal - /home/vagrant/shared/sample_app/db/test.sqlite3 /home/vagrant/shared/sample_app/test/test_helper.rb:3:i

相关标签:
2条回答
  • 2021-01-12 15:44

    Move the database files outside vagrant share, for example to /tmp.

    edit database.yml:

    development:
      <<: *default
      database: /tmp/project/development.sqlite3
    
    test:
      <<: *default
      database: /tmp/project/test.sqlite3
    
    0 讨论(0)
  • 2021-01-12 15:47

    Workaround:

    The error was related to Vagrant (or VirtualBox) custom shared folders. I couldn't figure out how to solve it, but there is a workaround. Instead of working with a vagrant custom shared folder (~/shared/sample_app), defined in the vagrantfile I moved the app folder to a standard shared folder inside the VM root (/vagrant). Now I still get the file sync in my host machine and the issue is gone.


    UPDATE 1

    Reached another conclusion today. Everytime bundle exec rake db:migrate or rails generate migration is executed the error will return.

    Another Workaround
    1 - Delete the test.sqlite3 file.
    2 - Copy the development.sqlite3 file
    3 - Paste and change the name to test.sqlite3

    * - Just migrated for testing and this seems to be a permanent solution.

    0 讨论(0)
提交回复
热议问题