Errno::EACCES: 运行 rake test:models 时权限被拒绝@ unlink_internal [英] Errno::EACCES: Permission denied @ unlink_internal when running rake test:models

查看:59
本文介绍了Errno::EACCES: 运行 rake test:models 时权限被拒绝@ unlink_internal的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 rails 4.我刚刚为我的模型创建了非常简单的测试,但是当我尝试执行rake test:models"时出现以下错误:

I'm playing with rails 4. I just created very simple test for my model but when I try to execute "rake test:models" I get 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)

我的测试数据库配置如下:

My test database configuration looks as follows:

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

"/tmp/db" 是我在个人笔记本电脑上拥有完全访问权限的目录.

"/tmp/db" is directory where I have full access on my personal laptop.

任何想法可能是这个问题的根源?

Any ideas what could be source of this problem?

推荐答案

我能够绕过这个错误的一种方法是使用

One way I was able to get around this error was using

rake db:migrate rails_env=test

这在我的 test.sqlite3 上生成了必要的迁移

This generated the necessary migrations on my test.sqlite3

我相信 rails_env 的默认设置是dev",但这可能会有所不同.我对 Rails 还是很陌生,但我希望这会有所帮助.

I believe the default setting for rails_env is "dev" but this may vary. I am still very new to rails but I hope this helps.

这篇关于Errno::EACCES: 运行 rake test:models 时权限被拒绝@ unlink_internal的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆