sed の挙動はプラットフォームによって異なりますが、プログラムを用意しておくことにより差異を吸収できます。
FileUtils.sed("/file/path", /hoge/, "hage")
module FileUtils
def self.sed(file, pattern, replacement)
File.open(file, "r") do |f_in|
buf = f_in.read
buf.gsub!(pattern, replacement)
File.open(file, "w") do |f_out|
f_out.write(buf)
end
end
end
end


