Rails 错误::EACCES 权限被拒绝 [英] Rails Errno::EACCES Permission Denied

查看:61
本文介绍了Rails 错误::EACCES 权限被拒绝的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Rails 3.1 乘客在 Apache 开发环境中当我访问我得到的路线的索引(即 GET)时:

Rails 3.1 Passenger on Apache Development environment When I go to access the index (i.e. GET) for a route I get:

Errno::EACCES in Crb_agendas#index

Showing /var/www/crbagenda/app/views/layouts/application.html.erb where line #5 raised:

Permission denied - /var/www/crbagenda/tmp/cache/assets/E2C

Extracted source (around line #5):

2: <html>
3: <head>
4:   <title>CrbAgendas</title>
5:   <%= stylesheet_link_tag "application" %>
6:   <%= javascript_include_tag "application" %>
7:   <%= csrf_meta_tags %>
8: </head>

Rails.root: /var/www/crbagenda

当我转到提到的路径 (/var/www/crbagenda/tmp/cache/assets/E2C) 时,没有 E2C 文件夹,根目录(apache 运行的方式)拥有资产目录...不确定是什么我在这里做错了......或者我可以展示什么来帮助.

When I go to the path mentioned (/var/www/crbagenda/tmp/cache/assets/E2C) there is no E2C folder and root (what apache is running as) owns the assets dir... not sure what I did wrong here.... or what else I could show to help.

推荐答案

当我遇到这个错误并且运行 chmod 777 不是这里的解决方案时,我发现了这篇文章.

I found this post when I encountered this error and running chmod 777 is not the solution here.

您需要对如何启用组权限和适当配置 apaches 设置进行一些研究.这是一个 Stack Exchange 线程,其中详细介绍了这一点并包含有用的链接.确保 apache 具有对适当目录的读取、写入和执行访问权限,但不要简单地让任何人修改目录.找到您的系统 apache 组并运行 chownchmod -g+[Apache 需要什么权限在这里] 我建议不要使用 -R 选项并主动查看 apache 对特定目录需要哪些权限.关于 apache 权限和权限的 Stack Exchange 线程链接一般

You need to do some research on how to enable group permissions and configure apaches settings appropriately. Here is a Stack Exchange thread that details this rather well and contains useful links. Make sure apache has read, write and execute access to the appropriate directories but don't simply let ANYONE modify the directory. Locate your systems apache group and run chown and chmod -g+[What permissions apache needs goes here] I would suggest not running this with the -R option and to actively look into which permission apache needs for specific directories. Link to Stack Exchange thread regarding apache permissions and permissions in general

这篇关于Rails 错误::EACCES 权限被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆