[英]ruby on rails Errno::EACCES Permission denied @ rb_sysopen - product.log
def show
name = @product.ProductName
File.open('product.log', 'a+') do |f2|
f2.write Time.new
f2.write "==>"
end
it works fine on my local machine (mac) and this error comes when I deploy on ubuntu
server (EC2 ) 它在我的本地计算机(mac)上工作正常,并且当我在
ubuntu
服务器(EC2)上部署时出现此错误
Try File.open("#{Rails.root}/product.log", 'a+') do |f2|
尝试
File.open("#{Rails.root}/product.log", 'a+') do |f2|
if it is at root, or whatever its path is. 它是根源还是路径。
If it still doesn't work try changing permission to 775. 如果仍然无法正常工作,请尝试将权限更改为775。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.