Rails 控制台访问权限被拒绝 @ rb_sysopen 错误
当我尝试使用 Rails c 访问 Rails 控制台时,终端给出了此错误 :权限被拒绝@ rb_sysopen - /Users/yannherveeaniman/.irb_history (Errno::EACCES)
如何解决此问题?
When I try to access rails console with rails c, terminal gives me this error: Permission denied @ rb_sysopen - /Users/yannherveeaniman/.irb_history (Errno::EACCES)
How can I solve this problem?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
看起来像是权限问题。我找到了2个解决方案。我希望其中之一能够解决您的问题。
查看错误,似乎无法访问。我们可以尝试通过以下命令授予访问权限
sudo chmod -R 777 /Users/yannherveeaniman/.irb_history
(授予对文件的所有访问权限)或者
sudo chmod -R 777 /Users/yannherveeaniman
(授予对您的文件夹的所有访问权限)创建/编辑
~/.irbrc
制作人员 - https://stackoverflow.com/a/52360668/18073270
感谢您接触这个美丽的平台。希望您的问题能够得到解决。
问候。
It Looks like permission issue. I found 2 solutions. I hope one of them will solve your issue.
Looking at the error it seems like it is unable to access. We can try to give access by below command
sudo chmod -R 777 /Users/yannherveeaniman/.irb_history
(giving all access to file)OR
sudo chmod -R 777 /Users/yannherveeaniman
(giving all access to your folder)create/edit
~/.irbrc
credits - https://stackoverflow.com/a/52360668/18073270
Thank You for reaching out to this beautiful platform. Hopefully your issues will be resolved.
Regards.
'write':权限被拒绝@ rb_sysopen - tmp/sockets/puma.state (Errno::EACCES)
由于名为 puma 的 gem,我遇到了类似的问题。每当我运行“rails s”来启动 Rails 服务器时,我得到
“写入”:权限被拒绝@ rb_sysopen - tmp/sockets/puma.state (Errno::EACCES)
所以解决方案非常先进,首先我检查了导致问题“tmp/sockets/puma.rb”的文件的权限,
因此它在用户级别具有写入权限。
如果没有尝试为其分配写权限,但仅限于用户级别。
然后我尝试将所有权更改为当前用户。
这就是我的技巧。
在尝试此操作之前,请确保几件事。
系统级红宝石宝石。
从 .ruby-version 文件中自动选择 ruby 版本。但让
通过运行“ruby -v”确保您使用的是正确的当前 ruby 版本。
'write': Permission denied @ rb_sysopen - tmp/sockets/puma.state (Errno::EACCES)
I faced a similar issue due to a gem called puma. whenever I run "rails s" to start rails server I got
'write': Permission denied @ rb_sysopen - tmp/sockets/puma.state (Errno::EACCES)
so the solution was pretty forward first of all i checked the permissions for the file causing issue 'tmp/sockets/puma.rb'
so it had a write permission at user level.
if not try to assign it write permission but only at user level.
Then I try to change ownership to current user.
and that was my hack.
Before trying this make sure a few things.
gems at system level ruby.
picks automatically ruby version from .ruby-version file. But make
sure that you are using correct current ruby version by running 'ruby -v'.