2012-02-07 95 views
0

當我嘗試在RubyMine中運行cucumbertest任務時出現錯誤。 spec運行良好。無法運行黃瓜並在RubyMine中測試

權限被拒絕 - DB/test.sqlite3

這就是跟蹤。我該如何解決它?

 
C:\RailsInstaller\Ruby1.9.2\bin\ruby.exe -e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) C:\RailsInstaller\Ruby1.9.2\bin\rake cucumber --trace 
Testing started at 23:35 ... 
WARNING: Cucumber-rails required outside of env.rb. The rest of loading is being defered until env.rb is called. 
    To avoid this warning, move 'gem cucumber-rails' under only group :test in your Gemfile 
*** WARNING: You must use ANSICON 1.31 or higher (http://adoxa.110mb.com/ansicon) to get coloured output on Windows 
** Invoke cucumber (first_time) 
** Invoke cucumber:ok (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:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/activerecord-3.1.3/lib/active_record/railties/databases.rake:460:in `delete' 
C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/activerecord-3.1.3/lib/active_record/railties/databases.rake:460:in `block (3 levels) in ' 
C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call' 
C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `block in execute' 
C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each' 
C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute' 
C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain' 
C:/RailsInstaller/Ruby1.9.2/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize' 
C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain' 
C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:176:in `block in invoke_prerequisites' 
C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:174:in `each' 
C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:174:in `invoke_prerequisites' 
C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:157:in `block in invoke_with_call_chain' 
C:/RailsInstaller/Ruby1.9.2/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize' 
C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain' 
C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke' 
C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/activerecord-3.1.3/lib/active_record/railties/databases.rake:483:in `block (3 levels) in ' 
C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call' 
C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `block in execute' 
C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each' 
C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute' 
C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain' 
C:/RailsInstaller/Ruby1.9.2/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize' 
C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain' 
C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:176:in `block in invoke_prerequisites' 
C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:174:in `each' 
C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:174:in `invoke_prerequisites' 
C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:157:in `block in invoke_with_call_chain' 
C:/RailsInstaller/Ruby1.9.2/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize' 
C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain' 
C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:176:in `block in invoke_prerequisites' 
C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:174:in `each' 
C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:174:in `invoke_prerequisites' 
C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:157:in `block in invoke_with_call_chain' 
C:/RailsInstaller/Ruby1.9.2/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize' 
C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain' 
C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke' 
C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:116:in `invoke_task' 
C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block (2 levels) in top_level' 
C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `each' 
C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block in top_level' 
C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling' 
C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:88:in `top_level' 
C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:66:in `block in run' 
C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling' 
C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run' 
C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/bin/rake:33:in `' 
C:/RailsInstaller/Ruby1.9.2/bin/rake:19:in `load' 
C:/RailsInstaller/Ruby1.9.2/bin/rake:19:in `' 
-e:1:in `load' 
-e:1:in `' 
Tasks: TOP => db:test:load => db:test:purge 

Process finished with exit code 1 

回答

1

移動黃瓜軌寶石只有測試組內部在你的Gemfile並添加require: false。它應該看起來像這樣:

group :test do 
    gem 'cucumber-rails', require: false 
    … 
end