开发者

No such file or directory

This is the error.

Atrosity [ Eric-Raios-MacBook ][ ~/dev/rubyscripts ]$ ruby script.rb 
script.rb:7:in `read': No such file or directory - sent开发者_开发技巧 (Errno::ENOENT)
from script.rb:7:in `lSent'
from script.rb:16:in `<main>'

My Method that is causing the error is:

def lSent
  $sent = Set.new(File.read("sent").split(";"))
end

lSent

If I delete this, my script runs but does not output what I want to do.


sent should be a path to a file in your server, such as

$sent = Set.new(File.read("/root/path/file.txt").split(";"))


You're attempting to read a file called "sent", but it doesn't exist in the application's path. Try including the full path to the file.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜