[英]Getting permission denied error when I run "gem install bundler"
I'm setting up my environment to run Cucumber/Rspec with Ruby and Capybara.我正在设置我的环境以使用 Ruby 和 Capybara 运行 Cucumber/Rspec。
However, when I run the command "sudo gem install bundler" the error below is being returned:但是,当我运行命令“sudo gem install bundler”时,将返回以下错误:
Permission denied @ rb_sysopen
I've seen lots of answers for this problem on Google however still not working.我在谷歌上看到了很多关于这个问题的答案,但仍然无法正常工作。
Could you guys help me?你们能帮我吗?
Technical info技术信息
- Mac
- ruby 2.3.7
- RUBYGEMS VERSION: 3.0.3
Output输出
ERROR: While executing gem ... (Errno::EACCES)
Permission denied @ rb_sysopen -
/Library/Ruby/Gems/2.3.0/gems/bundler-2.0.2/CHANGELOG.md
Thanks!谢谢!
you are using the system's ruby and now you need to root level permission to to install bundler.您正在使用系统的 ruby,现在您需要 root 级别的权限才能安装 bundler。 Sudo enables root privileges.
Sudo 启用 root 权限。 Check if your account has root privileges.
检查您的帐户是否具有 root 权限。
I prefer using a version and manager like rbenv .我更喜欢使用像rbenv这样的版本和管理器。 Install rbenv .
安装 rbenv 。 then install the required version of ruby and then install bundler.
然后安装所需版本的ruby,然后安装bundler。
You might want to use ruby installers like rvm.io
or rbenv
to install ruby.您可能想使用
rvm.io
或rbenv
等 ruby 安装程序来安装 ruby。 You are using system ruby which needs root access of the system to install gems.您正在使用系统 ruby,它需要系统的 root 访问权限才能安装 gems。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.