简体   繁体   English

Ubuntu 12.04 ruby​​软件包安装错误

[英]Ubuntu 12.04 ruby bundle install error

I'm trying to deploy a rails app to my Ubuntu server. 我正在尝试将Rails应用程序部署到我的Ubuntu服务器。 I already installed rvm and right now I'm trying to use bundler in order to deploy my app. 我已经安装了rvm ,现在我正尝试使用bundler来部署我的应用程序。

However I'm getting this: 但是我得到这个:

/usr/local/rvm/rubies/ruby-1.9.3-p374/lib/ruby/1.9.1/fileutils.rb:247:in `mkdir': Permission denied - /myroot/repos/myapp/.bundle (Errno::EACCES)

First, What user is executing the whole rvm commands? 首先,什么用户正在执行整个rvm命令? I mean I have rake , bundle etc, in my path, but I don't know exactly which user is executing them. 我的意思是我的路径中有rakebundle等,但我不知道是哪个用户在执行它们。

As a first intent I tried changing the permissions for all the files inside /myapp folder. 首先,我尝试更改/myapp文件夹中所有文件的权限。 Giving them root:rvm , but no luck. 给他们root:rvm ,但是没有运气。

Now if I try to run the bundle command as sudo (or in fact any ruby command) I'm getting errors similar to this one: 现在,如果我尝试以sudo (或实际上是任何ruby命令)的身份运行bundle命令,我将收到与此错误类似的错误:

/usr/local/rvm/gems/ruby-1.9.3-p374@global/bin/ruby_noexec_wrapper

So, a little explanation of what the wrapper is and why is it not finding ruby would help me a lot to understand this kind of error. 因此,对什么是包装纸以及为什么找不到红宝石的一些解释将对我理解这种错误有很大帮助。

It is recommended to not use sudo for rvm , ruby and any RubyGems installed commands as sudo by default losses environment variables used to configure RVM / Ruby / RubyGems. 建议不要使用sudorvmruby和安装为命令的任何RubyGems的sudo被用于配置RVM /红宝石/ RubyGems的违约损失的环境变量。

If you really need to use sudo - go with rvmsudo - but I need to warn you it elevates privileges exposing your system, it's a security risk. 如果您确实需要使用sudo (请与rvmsudo一起使用),但是我需要警告您,它会提高公开系统的特权,这是安全隐患。

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

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