权限被拒绝安装rabl gem

时间:2017-10-25 19:26:58

标签: ruby-on-rails ruby ruby-on-rails-4

我正在尝试安装spree gem,但我在安装gem时遇到一些麻烦。目前我在尝试安装rabl(0.13.1)宝石时遇到错误。我获得了许可被拒绝。想知道我怎么能解决这个错误,所以我可以回来完成安装狂欢。

Installing rabl 0.13.1
Errno::EACCES: Permission denied @ rb_file_s_symlink -
(fixtures/ashared/views_rails_3/users/phone_number.json.rabl,
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rabl-0.13.1/fixtures/ashared/views_rails_3/users/phone_number.xml.rabl)
An error occurred while installing rabl (0.13.1), and Bundler cannot continue.
Make sure that `gem install rabl -v '0.13.1'` succeeds before bundling.

In Gemfile:
  spree was resolved to 3.4.1, which depends on
    spree_backend was resolved to 3.4.1, which depends on
      spree_api was resolved to 3.4.1, which depends on
        rabl

C:\Users\Michael\Desktop\ruby\pen>gem install rabl -v '0.13.1
ERROR:  While executing gem ... (Errno::EACCES)
    Permission denied @ rb_file_s_symlink - (fixtures/ashared/views_rails_3/users/phone_number.json.rabl, C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rabl-0.13.1/fixtures/ashared/views_rails_3/users/phone_number.xml.rabl)

C:\Users\Michael\Desktop\ruby\pen>gem install
ERROR:  While executing gem ... (Gem::CommandLineError)
    Please specify at least one gem name (e.g. gem build GEMNAME)

C:\Users\Michael\Desktop\ruby\pen>uby/gems/2.4
'uby' is not recognized as an internal or external command,
operable program or batch file.
coins

4 个答案:

答案 0 :(得分:0)

首先,我建议您使用bundler进行自动依赖性解析。

关于您的问题,我认为根本原因在于:Permission denied @ rb_file_s_symlink - (fixtures/ashared/views_rails_3/users/phone_number.json.rabl

您应该检查此文件的权限,并可能修复它们。因为您当前的用户没有足够的权限来访问它。

最后,但并非最不重要,尝试切换到linux / mac。 Windows真的不适合高效的Ruby开发。

答案 1 :(得分:0)

您可以通过在Windows上运行终端(“使用Ruby启动命令提示符”,“Git Bash”或类似命令)来修复它。

答案 2 :(得分:0)

尝试在rails上的ruby上安装Spree gem时遇到了这个问题。

这是在Rails 5.1.4上完成的,运行Ruby ruby​​ 2.3.3p222

如果您没有管理员权限,则会发生此错误。

首先,找到cmd,然后右键单击它,然后点击“以管理员身份运行”#。

使用适当的凭据登录,然后当cmd弹出时,再次运行命令

  

gem install rabl -v' 0.13.1'

它应该会成功!

答案 3 :(得分:0)

如果有人在Windows环境(Windows 10)中遇到此问题, 使用start command prompt with ruby作为管理员 并运行bundle update