Railsでモデルのテストをするために、下記コマンドでrspecを実行したところ、エラーが表示されます。原因について知りたいです。どなたか、お分かりになる方、アドバイスをお願いします。
bundle exec rspec spec/models/blog_spec.rb
エラー内容
rails aborted! ActiveRecord::Tasks::DatabaseAlreadyExists: ActiveRecord::Tasks::DatabaseAlreadyExists /vagrant/hello_rails_a/bin/rails:9:in `<top (required)>' /vagrant/hello_rails_a/bin/spring:15:in `require' /vagrant/hello_rails_a/bin/spring:15:in `<top (required)>' bin/rails:3:in `load' bin/rails:3:in `<main>' Caused by: Errno::ETXTBSY: Text file busy @ apply2files - /vagrant/hello_rails_a/db/test.sqlite3 /vagrant/hello_rails_a/bin/rails:9:in `<top (required)>' /vagrant/hello_rails_a/bin/spring:15:in `require' /vagrant/hello_rails_a/bin/spring:15:in `<top (required)>' bin/rails:3:in `load' bin/rails:3:in `<main>' Tasks: TOP => db:test:load => db:test:purge (See full trace by running task with --trace) An error occurred while loading ./spec/models/blog_spec.rb. Failure/Error: ActiveRecord::Migration.maintain_test_schema! ActiveRecord::PendingMigrationError: Migrations are pending. To resolve this issue, run: bin/rails db:migrate RAILS_ENV=test No examples found. Finished in 0.00078 seconds (files took 5.52 seconds to load) 0 examples, 0 failures, 1 error occurred outside of examples

回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2019/08/21 11:03