test:units - Permission denied

I'm having an issue running test:units through RubyMine (Windows 7).  Here's the full trace:

C:\Ruby192\bin\ruby.exe -e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) C:\Ruby192\bin\rake test:units --trace
Testing started at 1:13 PM ...
** Invoke test:units (first_time)
** Invoke test:prepare (first_time)
** Invoke db:test:prepare (first_time)
** Invoke db:abort_if_pending_migrations (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:abort_if_pending_migrations
** Execute db:test:prepare
** Invoke db:test:load (first_time)
** Invoke db:test:purge (first_time)
** Invoke environment
** Execute db:test:purge
rake aborted!
Permission denied - db/test.sqlite3
C:/Projects/project/.bundle/ruby/1.9.1/gems/activerecord-3.1.0/lib/active_record/railties/databases.rake:458:in `delete'
C:/Projects/project/.bundle/ruby/1.9.1/gems/activerecord-3.1.0/lib/active_record/railties/databases.rake:458:in `block (3 levels) in <top (required)>'
C:/Projects/project/.bundle/ruby/1.9.1/gems/rake-0.9.2/lib/rake/task.rb:205:in `call'
C:/Projects/project/.bundle/ruby/1.9.1/gems/rake-0.9.2/lib/rake/task.rb:205:in `block in execute'
C:/Projects/project/.bundle/ruby/1.9.1/gems/rake-0.9.2/lib/rake/task.rb:200:in `each'
C:/Projects/project/.bundle/ruby/1.9.1/gems/rake-0.9.2/lib/rake/task.rb:200:in `execute'
C:/Projects/project/.bundle/ruby/1.9.1/gems/rake-0.9.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
C:/Ruby192/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
C:/Projects/project/.bundle/ruby/1.9.1/gems/rake-0.9.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
C:/Projects/project/.bundle/ruby/1.9.1/gems/rake-0.9.2/lib/rake/task.rb:176:in `block in invoke_prerequisites'
C:/Projects/project/.bundle/ruby/1.9.1/gems/rake-0.9.2/lib/rake/task.rb:174:in `each'
C:/Projects/project/.bundle/ruby/1.9.1/gems/rake-0.9.2/lib/rake/task.rb:174:in `invoke_prerequisites'
C:/Projects/project/.bundle/ruby/1.9.1/gems/rake-0.9.2/lib/rake/task.rb:157:in `block in invoke_with_call_chain'
C:/Ruby192/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
C:/Projects/project/.bundle/ruby/1.9.1/gems/rake-0.9.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
C:/Projects/project/.bundle/ruby/1.9.1/gems/rake-0.9.2/lib/rake/task.rb:144:in `invoke'
C:/Projects/project/.bundle/ruby/1.9.1/gems/activerecord-3.1.0/lib/active_record/railties/databases.rake:481:in `block (3 levels) in <top (required)>'
C:/Projects/project/.bundle/ruby/1.9.1/gems/rake-0.9.2/lib/rake/task.rb:205:in `call'
C:/Projects/project/.bundle/ruby/1.9.1/gems/rake-0.9.2/lib/rake/task.rb:205:in `block in execute'
C:/Projects/project/.bundle/ruby/1.9.1/gems/rake-0.9.2/lib/rake/task.rb:200:in `each'
C:/Projects/project/.bundle/ruby/1.9.1/gems/rake-0.9.2/lib/rake/task.rb:200:in `execute'
C:/Projects/project/.bundle/ruby/1.9.1/gems/rake-0.9.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
C:/Ruby192/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
C:/Projects/project/.bundle/ruby/1.9.1/gems/rake-0.9.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
C:/Projects/project/.bundle/ruby/1.9.1/gems/rake-0.9.2/lib/rake/task.rb:176:in `block in invoke_prerequisites'
C:/Projects/project/.bundle/ruby/1.9.1/gems/rake-0.9.2/lib/rake/task.rb:174:in `each'
C:/Projects/project/.bundle/ruby/1.9.1/gems/rake-0.9.2/lib/rake/task.rb:174:in `invoke_prerequisites'
C:/Projects/project/.bundle/ruby/1.9.1/gems/rake-0.9.2/lib/rake/task.rb:157:in `block in invoke_with_call_chain'
C:/Ruby192/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
C:/Projects/project/.bundle/ruby/1.9.1/gems/rake-0.9.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
C:/Projects/project/.bundle/ruby/1.9.1/gems/rake-0.9.2/lib/rake/task.rb:176:in `block in invoke_prerequisites'
C:/Projects/project/.bundle/ruby/1.9.1/gems/rake-0.9.2/lib/rake/task.rb:174:in `each'
C:/Projects/project/.bundle/ruby/1.9.1/gems/rake-0.9.2/lib/rake/task.rb:174:in `invoke_prerequisites'
C:/Projects/project/.bundle/ruby/1.9.1/gems/rake-0.9.2/lib/rake/task.rb:157:in `block in invoke_with_call_chain'
C:/Ruby192/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
C:/Projects/project/.bundle/ruby/1.9.1/gems/rake-0.9.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
C:/Projects/project/.bundle/ruby/1.9.1/gems/rake-0.9.2/lib/rake/task.rb:144:in `invoke'
C:/Projects/project/.bundle/ruby/1.9.1/gems/rake-0.9.2/lib/rake/application.rb:112:in `invoke_task'
C:/Projects/project/.bundle/ruby/1.9.1/gems/rake-0.9.2/lib/rake/application.rb:90:in `block (2 levels) in top_level'
C:/Projects/project/.bundle/ruby/1.9.1/gems/rake-0.9.2/lib/rake/application.rb:90:in `each'
C:/Projects/project/.bundle/ruby/1.9.1/gems/rake-0.9.2/lib/rake/application.rb:90:in `block in top_level'
C:/Projects/project/.bundle/ruby/1.9.1/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
C:/Projects/project/.bundle/ruby/1.9.1/gems/rake-0.9.2/lib/rake/application.rb:84:in `top_level'
C:/Projects/project/.bundle/ruby/1.9.1/gems/rake-0.9.2/lib/rake/application.rb:62:in `block in run'
C:/Projects/project/.bundle/ruby/1.9.1/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
C:/Projects/project/.bundle/ruby/1.9.1/gems/rake-0.9.2/lib/rake/application.rb:59:in `run'
C:/Projects/project/.bundle/ruby/1.9.1/gems/rake-0.9.2/bin/rake:32:in `<top (required)>'
C:/Ruby192/bin/rake:19:in `load'
C:/Ruby192/bin/rake:19:in `<top (required)>'
-e:1:in `load'
-e:1:in `<main>'
Tasks: TOP => db:test:load => db:test:purge

Process finished with exit code 1

Any idea how to fix this?

2 comments
Comment actions Permalink

I also failed to mention that this doesn't happen when I run "bundle exec rake test:units" from the command line.  I have "Run the script in the context of bundle (bundle exec)" checked in the configuration.

0
Comment actions Permalink

Which permissions does db/test.sqlite3 file have ?

0

Please sign in to leave a comment.