简体   繁体   English

Rails 控制台访问权限被拒绝@rb_sysopen 错误

[英]Rails console access gets Permission denied @ rb_sysopen Error

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)当我尝试使用 rails c 访问 rails 控制台时,终端给我这个错误: Permission denied @ rb_sysopen - /Users/yannherveeaniman/.irb_history (Errno::EACCES)

How can I solve this problem?我怎么解决这个问题?

It Looks like permission issue.看起来像权限问题。 I found 2 solutions.我找到了 2 个解决方案。 I hope one of them will solve your issue.我希望其中之一能解决您的问题。

  1. 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) sudo chmod -R 777 /Users/yannherveeaniman/.irb_history (授予对文件的所有访问权限)

    OR或者

    sudo chmod -R 777 /Users/yannherveeaniman (giving all access to your folder) sudo chmod -R 777 /Users/yannherveeaniman (授予对您文件夹的所有访问权限)

  2. create/edit ~/.irbrc创建/编辑~/.irbrc

     require 'irb/ext/save-history' IRB.conf[:SAVE_HISTORY] = 10000 IRB.conf[:HISTORY_FILE] = "#{ENV['HOME']}/.irb-history"

    credits - https://stackoverflow.com/a/52360668/18073270学分 - https://stackoverflow.com/a/52360668/18073270

Thank You for reaching out to this beautiful platform.感谢您来到这个美丽的平台。 Hopefully your issues will be resolved.希望您的问题将得到解决。

Regards.问候。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM