2012-03-22 113 views
3

我對這位先生有類似的problem沒有這樣的文件或目錄 -/dev/null(Errno :: ENOENT)

我一直在嘗試通過rake任務運行黃瓜功能。我一直在挑選標題中的指定錯誤。

這是一個完整的回溯。我的紅寶石版本。 (當我試圖運行軌道version命令,我得到 「命令未找到」。

$ rake features:all --trace 
** Invoke features:all (first_time) 
** Invoke features:watir_webdriver (first_time) 
** Execute features:watir_webdriver 
c:/Ruby193/bin/ruby -S bundle exec cucumber --profile watir 
Using the watir profile... 
No such file or directory - /dev/null (Errno::ENOENT) 
c:/Ruby193/lib/ruby/1.9.1/webrick/log.rb:34:in `initialize' 
c:/Ruby193/lib/ruby/1.9.1/webrick/log.rb:34:in `open' 
c:/Ruby193/lib/ruby/1.9.1/webrick/log.rb:34:in `initialize' 
c:/Ruby193/lib/ruby/1.9.1/webrick/log.rb:124:in `initialize' 
c:/code/page-object/features/sample-app/sample_app.rb:12:in `new' 
c:/code/page-object/features/sample-app/sample_app.rb:12:in `start' 
c:/code/page-object/features/support/ajax_text_environment.rb:6:in `block in run' 
rake aborted! 
Command failed with status (1): [c:/Ruby193/bin/ruby -S bundle exec cucumbe...] 
c:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/file_utils.rb:53:in `block in create_shell_runner' 
c:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/file_utils.rb:45:in `call' 
c:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/file_utils.rb:45:in `sh' 
c:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/file_utils_ext.rb:39:in `sh' 
c:/Ruby193/lib/ruby/gems/1.9.1/gems/cucumber-1.1.9/lib/cucumber/rake/task.rb:104:in `run' 
c:/Ruby193/lib/ruby/gems/1.9.1/gems/cucumber-1.1.9/lib/cucumber/rake/task.rb:193:in `block in define_task' 
c:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call' 
c:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `block in execute' 
c:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each' 
c:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute' 
c:/Ruby193/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:/Ruby193/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize' 
c:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain' 
c:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:176:in `block in invoke_prerequisites' 
c:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:174:in `each' 
c:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:174:in `invoke_prerequisites' 
c:/Ruby193/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:/Ruby193/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize' 
c:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain' 
c:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke' 
c:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:116:in `invoke_task' 
c:/Ruby193/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:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `each' 
c:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block in top_level' 
c:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling' 
c:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:88:in `top_level' 
c:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:66:in `block in run' 
c:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling' 
c:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run' 
c:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/bin/rake:33:in `<top (required)>' 
c:/Ruby193/bin/rake:19:in `load' 
c:/Ruby193/bin/rake:19:in `<main>' 
Tasks: TOP => features:all => features:watir_webdriver 

和Ruby版本

ruby -v 
ruby 1.9.3p0 (2011-10-30) [i386-mingw32] 

任何幫助,將無限感激。謝謝。

+2

看看其他問題的回答和評論。具體來說,你的代碼(或配置)是否在某處配置了一個Logger? – robinst 2012-03-22 15:15:26

+0

我沒有,我也不完全確定如何真正配置它。有人在其他意見部分建議這樣做,但我不能100%確定如何。否則,我會全力以赴。 建議? – RazokKull 2012-03-22 15:21:24

+1

嘗試在存儲庫中搜索'/ dev/null'(例如,如果您使用git,請使用'git grep/dev/null /')。 – robinst 2012-03-22 15:29:32

回答

0

我實際上已經發現了它,在我正在使用的應用程序中,在一個稍微模糊的文件中有一個配置設置,它將記錄器的路徑設置爲「/ dev/null」,我只是將其更改爲「logger.txt 「它現在有效。

9

dev/nullconfig/initializers/quiet_assets和我取代dev/nulllogger.txt

+0

大awnser:ð我會+2這個,如果我可以 – Francois 2012-10-14 19:38:18

1

如果你是對的* nix和Windows相同的應用程序的工作,你可以用RUBY_PLATFORM != 'i386-mingw32' ? '/dev/null' : 'NUL'

更換'/dev/null'

對我來說這是quiet_assets .rb和我替換的

Rails.application.assets.logger = Logger.new('/dev/null')

Rails.application.assets.logger = Logger.new(RUBY_PLATFORM != 'i386-mingw32' ? '/dev/null' : 'NUL')

+0

我使用webmachine-ruby的一個例子,這個補丁適用於我。 – 2016-06-13 17:48:16

相關問題