1
我需要給上紅寶石提示錯誤的Ruby on Windows 7的變量Errno :: ENOENT:
irb(main):007:0> f = File.new("C:\Users\ABHIJI~1.SHE\AppData\Local\Temp\myoutp>
Errno::ENOENT: No such file or directory - ls -alF C:UsersABHIJI\~1.SHEAppDataLo
calTemp\myoutput.txt
from C:/Ruby/Ruby193/lib/ruby/gems/1.9.1/gems/awesome_print-1.1.0/lib/aw
esome_print/formatter.rb:191:in ``'
from C:/Ruby/Ruby193/lib/ruby/gems/1.9.1/gems/awesome_print-1.1.0/lib/aw
esome_print/formatter.rb:191:in `awesome_file'
from C:/Ruby/Ruby193/lib/ruby/gems/1.9.1/gems/awesome_print-1.1.0/lib/aw
esome_print/formatter.rb:26:in `format'
from C:/Ruby/Ruby193/lib/ruby/gems/1.9.1/gems/awesome_print-1.1.0/lib/aw
esome_print/inspector.rb:137:in `unnested'
from C:/Ruby/Ruby193/lib/ruby/gems/1.9.1/gems/awesome_print-1.1.0/lib/aw
esome_print/inspector.rb:104:in `awesome'
from C:/Ruby/Ruby193/lib/ruby/gems/1.9.1/gems/awesome_print-1.1.0/lib/aw
esome_print/core_ext/kernel.rb:10:in `ai'
from C:/Ruby/Ruby193/lib/ruby/gems/1.9.1/gems/awesome_print-1.1.0/lib/aw
esome_print/core_ext/kernel.rb:15:in `ap'
from C:/Ruby/Ruby193/lib/ruby/gems/1.9.1/gems/awesome_print-1.1.0/lib/aw
esome_print/inspector.rb:31:in `output_value'
from C:/Ruby/Ruby193/bin/irb:12:in `<main>'
我已經給臨時文件夾的路徑命令。 我正在使用Windows 7和Ruby路徑是C:\ Ruby \ Ruby193 \ bin
f = File.new(「C://Users//ABHIJI~1.SHE//AppData//Local//Temp//myoutput.txt」,「w +」)不起作用即使正斜槓也不起作用 – Abhijit
@Abhijit使用正斜槓時,只能使用一個。使用反斜槓時只需加倍。 ''C:/Users/ABHIJI~1.SHE「'相當於'」C:\\ Users \\ ABHIJI〜1.SHE「'。 –
即使單斜線不工作 – Abhijit