错误:执行gem时(Gem :: FilePermissionError) [英] ERROR: While executing gem ... (Gem::FilePermissionError)

查看:1250
本文介绍了错误:执行gem时(Gem :: FilePermissionError)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我检查了所有其他类似的答案,其中没有一个与我的完全相同,也没有任何解决方案适用于我。

gem环境 sudo gem environment 给出相同的结果:

  RubyGems环境:
- RUBYGEMS版本:1.5.3
- RUBY VERSION:1.8.7(2011-12-28 patchlevel 357)[x86_64-linux]
- 安装目录:/usr/local/lib/ruby/gems/1.8
- RUBY EXECUTABLE:/ usr / local / bin / ruby​​
- 可执行目录:/ usr / local / bin
- RUBYGEMS平台:
- ruby​​
- x86_64-linux
- 创业板路径:
- /usr/local/lib/ruby/gems/1.8
- / home / ava / .gem / ruby​​ / 1.8
- GEM配置:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- 远程来源:
- 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:/家庭/ AVA /斌



gem install< gem-name> 给出

 错误:执行gem时(Gem :: FilePermissionError)
您没有写入/usr/local/lib/ruby/gems/1.8目录的权限。

而我可以通过sudo安装相同的服务。我做错了什么?



更新:



根据评论和信息,我跑了下面:



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

 错误运行'__rvm_make -j24',
请阅读/home/ava/.rvm/log/log/1378418790_ruby-1.9.3-p194/make.log
出现错误运行make。停止安装。

make.log

  [2013-09-05 22:06:48] make 
当前路径:/home/ava/.rvm/src/ruby -1.9.3-p194
命令(2):make -j24
CC = gcc
LD = ld
LDSHARED = gcc -shared
CFLAGS = -O3 - ggdb -Wextra -Wno-unused-parameter -Wno-括号-Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Werror-implicit-function-declaration - fPIC
XCFLAGS = -ruby / config.h -include ruby​​ / missing.h -fvisibility =隐藏-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
编译main.c
编译dmydln.c
编译dmyencoding.c
编译version.c
编译miniprelude.c
编译array.c
编译bignum.c
编译class.c
编译compar.c
编译complex.c
编译dir.c
编译dln_find.c
编译enum.c
编译enumerator.c
编译error.c
编译eval.c
编译load.c
编译proc.c
编译file.c



在ossl.h中包含的文件中:213,$ ossl_pkcs5.c中的
:5:
openssl_missing.h:71:错误:'HMAC_CTX_copy'的冲突类型
/ usr / local / include / openssl / hmac.h:102:错误:之前的'HMAC_CTX_copy'声明在这里
openssl_missing.h:95:错误:'EVP_CIPHER_CTX_copy'
/ usr / local / include /openssl/evp.h:459:错误:之前的声明'EVP_CIPHER_CTX_copy'在这里
make [2]:*** [ossl_pkcs5.o]错误1
在ossl.h中包含的文件中:213,
from ossl_x509req.c:11:




解决方案

如果您已经以root用户身份安装了 rvm ,那么您必须 sudo 来安装任何东西。



您可以以普通用户的身份在用户模式下安装 rvm ,在这种情况下,所有内容都存储在您的主目录中, sudo 是必需的。



如果您未提交此特定安装,请键入 sudo rvm implode 并重新开始。


I have checked all the other similar answers and none was exactly like mine, neither did any of those solutions work for me.

gem environment and sudo gem environment give the same result:

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> gives

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

whereas I am able to install the same via sudo. What am I doing wrong?

UPDATE:

As per comments and this post, I ran following:

rvm implode and then re installed the stable version. rvm install 1.9.3 or any other ruby installation fails with

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:
:
:
:

解决方案

If you have installed rvm as the root user, then you must sudo to install anything.

You can install rvm in user-mode as a regular user, in which case everything is stored in your home directory and no sudo is required.

If you are not committed to this particular install, type sudo rvm implode and start over.

这篇关于错误:执行gem时(Gem :: FilePermissionError)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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