而创业板安装在Ubuntu 12.04的错误AWS EC2 [英] Error while gem install on ubuntu 12.04 aws ec2

查看:123
本文介绍了而创业板安装在Ubuntu 12.04的错误AWS EC2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在AWS EC2得到了Ubuntu的12.04。
我只想创业板安​​装导轨上。
但它显示了此错误消息。
这是造成须藤宝石ENV的区别宝石ENV?
请问有什么办法可以解决,除非RVM破灭这个问题?
什么是使用rvmsudo而不是风险?

 撷取:原子1.1.15.gem(100%)
错误:在执行宝石...(GEM :: FilePermissionError)
您不必为/usr/local/rvm/gems/ruby-1.9.3-p545@global目录的写入权限。
 

宝石ENV:

  RubyGems的环境:
   -  RubyGems的版本:2.2.2
   -  RUBY版本:1.9.3(2014年2月24日补丁级别545)的x86_64-linux的]
   - 安装目录:/usr/local/rvm/gems/ruby-1.9.3-p545@global
   -  Ruby可执行文件:/usr/local/rvm/rubies/ruby-1.9.3-p545/bin/ruby
   - 可执行文件目录:/usr/local/rvm/gems/ruby-1.9.3-p545@global/bin
   -  SPEC缓存目录:/home/ubuntu/.gem/specs
   -  RubyGems的平台:
    - 红宝石
     -  x86_64的Linux的
   - 创业板路径:
      -  /usr/local/rvm/gems/ruby-1.9.3-p545@global
   - 创业板配置:
      - :update_sources =>真正
      - :冗长=>真正
      - :回溯=>假
      - :bulk_threshold => 1000
      - 宝石=> --no里--no-RDOC
   - 远程数据源:
      -  https://rubygems.org/
   -  shell路径:
      -  /usr/local/rvm/gems/ruby-1.9.3-p545@global/bin
      -  /usr/local/rvm/rubies/ruby-1.9.3-p545/bin
      - 在/ usr / local / sbin中
      - 在/ usr / local / bin目录
      -  / usr / sbin目录
      - 在/ usr /斌
      -  / sbin目录
      -  /斌
      - 在/ usr /游戏
      - 在/ usr /本地/ RVM /箱
 

sudo的创业板ENV:

  RubyGems的环境:
   -  RubyGems的版本:1.8.15
   -  RUBY版本:1.8.7(2011-06-30补丁级别352)的x86_64-linux的]
   - 安装目录:/var/lib/gems/1.8
   -  Ruby可执行文件:/usr/bin/ruby1.8
   - 可执行文件目录:在/ usr / local / bin目录
   -  RubyGems的平台:
    - 红宝石
     -  x86_64的Linux的
   - 创业板路径:
      -  /var/lib/gems/1.8
      -  /home/ubuntu/.gem/ruby/1.8
   - 创业板配置:
      - :update_sources =>真正
      - :冗长=>真正
      - :基准=>假
      - :回溯=>假
      - :bulk_threshold => 1000
      - 宝石=> --no里--no-RDOC
   - 远程数据源:
      -  http://rubygems.org/
 

解决方案
  

这是造成须藤宝石ENV的区别宝石ENV?

很可能, RVM 红宝石是独立的,不同系统的Ruby环境。

不过,它看起来像你运行的是RVM红宝石的宝石安装为不同的用户,作为的/ usr /本地/ RVM /宝石的所有者和它的子目录。

您运行的是什么用户RVM创业板安装的?

您可以试试这个:

  CHOWN -R用户任您想对运行命令as.user任您想对运行命令的在/ usr /本地/ RVM /宝石
 

或者也尝试像你提到的 rvmsudo 。那里的一些文件的风险可能具有的所有权,你可能不希望,如果你想更安全。

I got a ubuntu 12.04 in aws EC2.
I just want to gem install rails.
But it shows this error message.
Is this caused by the difference gem env between sudo gem env?
Is there any ways to solve this problem except rvm implode?
What's the risk of using rvmsudo instead?

Fetching: atomic-1.1.15.gem (100%)
ERROR:  While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /usr/local/rvm/gems/ruby-1.9.3-p545@global directory.

gem env:

RubyGems Environment:
  - RUBYGEMS VERSION: 2.2.2
  - RUBY VERSION: 1.9.3 (2014-02-24 patchlevel 545) [x86_64-linux]
  - INSTALLATION DIRECTORY: /usr/local/rvm/gems/ruby-1.9.3-p545@global
  - RUBY EXECUTABLE: /usr/local/rvm/rubies/ruby-1.9.3-p545/bin/ruby
  - EXECUTABLE DIRECTORY: /usr/local/rvm/gems/ruby-1.9.3-p545@global/bin
  - SPEC CACHE DIRECTORY: /home/ubuntu/.gem/specs
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-linux
  - GEM PATHS:
     - /usr/local/rvm/gems/ruby-1.9.3-p545@global
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :backtrace => false
     - :bulk_threshold => 1000
     - "gem" => "--no-ri --no-rdoc"
  - REMOTE SOURCES:
     - https://rubygems.org/
  - SHELL PATH:
     - /usr/local/rvm/gems/ruby-1.9.3-p545@global/bin
     - /usr/local/rvm/rubies/ruby-1.9.3-p545/bin
     - /usr/local/sbin
     - /usr/local/bin
     - /usr/sbin
     - /usr/bin
     - /sbin
     - /bin
     - /usr/games
     - /usr/local/rvm/bin

sudo gem env:

RubyGems Environment:
  - RUBYGEMS VERSION: 1.8.15
  - RUBY VERSION: 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux]
  - INSTALLATION DIRECTORY: /var/lib/gems/1.8
  - RUBY EXECUTABLE: /usr/bin/ruby1.8
  - EXECUTABLE DIRECTORY: /usr/local/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-linux
  - GEM PATHS:
     - /var/lib/gems/1.8
     - /home/ubuntu/.gem/ruby/1.8
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :benchmark => false
     - :backtrace => false
     - :bulk_threshold => 1000
     - "gem" => "--no-ri --no-rdoc"
  - REMOTE SOURCES:
     - http://rubygems.org/

解决方案

Is this caused by the difference gem env between sudo gem env?

Quite possible, the rvm Ruby is separate and different from the system Ruby environment.

However, it looks like you are running an rvm Ruby gem install as a different user as the owner of /usr/local/rvm/gems and it's subdirectories.

What user are you running the rvm gem install as?

You can try this:

chown -R user-you-want-to-run-command-as.user-you-want-to-run-command-as /usr/local/rvm/gems

Or also try like you mentioned rvmsudo. The risk there as the some of the files may have root ownership which you may not want if you want to be more secure.

这篇关于而创业板安装在Ubuntu 12.04的错误AWS EC2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆