Errno :: EACCES: Permission denied @unlink_internal when running the rake: model test

I play with rails 4. I just created a very simple test for my model, but when I try to run "rake test: models", I get the following error:

C:\rails\project>rake test:models DL is deprecated, please use Fiddle rake aborted! Errno::EACCES: Permission denied @ unlink_internal - /tmp/db/new.sqlite3 C:/rails/project/test/test_helper.rb:3:in `<top (required)>' C:/rails/project/test/models/admin_test.rb:1:in `<top (required)>' Tasks: TOP => test:models (See full trace by running task with --trace) 

The configuration of my test database is as follows:

 test: adapter: sqlite3 database: /tmp/db/new.sqlite3 pool: 5 timeout: 5000 

"/ tmp / db" is the directory in which I have full access to my personal laptop.

What ideas might be the source of this problem?

+6
source share
2 answers

One way I could get around this error was to use

 rake db:migrate rails_env=test 

This caused the necessary migrations on my test.sqlite3

I believe the default value for rails_env is "dev", but this may vary. I'm still very new to rails but hope this helps.

+8
source

I had the same problem with my test.sqlite3 table, and what worked for me made a copy of my development.sqlite3 table and renamed it test.sqlite3 . Hope this works for you.

+5
source

Source: https://habr.com/ru/post/978703/


All Articles