ERROR: While executing gem ... (Gem::FilePermissionError)[英] ERROR: While executing gem ... (Gem::FilePermissionError)

本文是小编为大家收集整理的关于ERROR: While executing gem ... (Gem::FilePermissionError)的处理方法,想解了ERROR: While executing gem ... (Gem::FilePermissionError)的问题怎么解决?ERROR: While executing gem ... (Gem::FilePermissionError)问题的解决办法?那么可以参考本文帮助大家快速定位并解决问题。

问题描述

我已经检查了所有其他类似的答案,没有一个与我的完全一样,这些解决方案也没有对我有用.

gem environment 和 sudo gem environment 给出相同的结果:

RubyGems Environment:
  - RUBYGEMS VERSION: 1.5.3
  - RUBY VERSION: 1.8.7 (2011-12-28 patchlevel 357) [x86_64-linux]
  - INSTALLATION DIRECTORY: /usr/local/lib/ruby/gems/1.8
  - RUBY EXECUTABLE: /usr/local/bin/ruby
  - EXECUTABLE DIRECTORY: /usr/local/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-linux
  - GEM PATHS:
     - /usr/local/lib/ruby/gems/1.8
     - /home/ava/.gem/ruby/1.8
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :benchmark => false
     - :backtrace => false
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - http://rubygems.org/

rvm -v : rvm 1.22.3

ruby -v : ruby 1.8.7

OSX 10.8.4

echo $PATH /usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:/home/ava/.rvm/bin:/home/ava/bin

gem install <gem-name> 给出

ERROR:  While executing gem ... (Gem::FilePermissionError)
    You don't have write permissions into the /usr/local/lib/ruby/gems/1.8 directory.

而我可以通过 sudo 安装它.我做错了什么?

更新:

根据评论和此 post,我跑了以下:

rvm implode 然后重新安装稳定版.rvm install 1.9.3 或任何其他 ruby​​ 安装失败

Error running '__rvm_make -j24',
please read /home/ava/.rvm/log/log/1378418790_ruby-1.9.3-p194/make.log
There has been an error while running make. Halting the installation.

make.log

    [2013-09-05 22:06:48] make
current path: /home/ava/.rvm/src/ruby-1.9.3-p194
command(2): make -j24
        CC = gcc
        LD = ld
        LDSHARED = gcc -shared
        CFLAGS = -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Werror-implicit-function-declaration  -fPIC
        XCFLAGS = -include ruby/config.h -include ruby/missing.h -fvisibility=hidden -DRUBY_EXPORT
        CPPFLAGS =   -I. -I.ext/include/x86_64-linux -I./include -I.
        DLDFLAGS = -Wl,-soname,libruby.so.1.9
        SOLIBS = -lpthread -lrt -ldl -lcrypt -lm
compiling main.c
compiling dmydln.c
compiling dmyencoding.c
compiling version.c
compiling miniprelude.c
compiling array.c
compiling bignum.c
compiling class.c
compiling compar.c
compiling complex.c
compiling dir.c
compiling dln_find.c
compiling enum.c
compiling enumerator.c
compiling error.c
compiling eval.c
compiling load.c
compiling proc.c
compiling file.c
:
:
:
In file included from ossl.h:213,
                 from ossl_pkcs5.c:5:
openssl_missing.h:71: error: conflicting types for ‘HMAC_CTX_copy’
/usr/local/include/openssl/hmac.h:102: error: previous declaration of ‘HMAC_CTX_copy’ was here
openssl_missing.h:95: error: conflicting types for ‘EVP_CIPHER_CTX_copy’
/usr/local/include/openssl/evp.h:459: error: previous declaration of ‘EVP_CIPHER_CTX_copy’ was here
make[2]: *** [ossl_pkcs5.o] Error 1
In file included from ossl.h:213,
                 from ossl_x509req.c:11:
:
:
:

推荐答案

如果你已经安装了 rvm 作为 root 用户,那么你必须 sudo 安装任何东西.

您可以作为普通用户在用户模式下安装 rvm,在这种情况下,所有内容都存储在您的主目录中,并且不需要 sudo.

如果您不致力于此特定安装,请键入 sudo rvm implode 并重新开始.

本文地址:https://www.itbaoku.cn/post/786480.html