Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
953 views
in Technique[技术] by (71.8m points)

ruby on rails - Errno::EACCES: Permission denied @ unlink_internal when running 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:
ailsproject>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" is directory where I have full access on my personal laptop.

Any ideas what could be source of this problem?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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

rake db:migrate rails_env=test

This generated the necessary migrations on my test.sqlite3

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...