安装“ferret”时出现 Errno::EEXIST 文件存在错误来自本地 .gem 文件的 gem
我正在尝试在 RHEL zlinux(s390x 架构)计算机上安装 ferret
ruby gem,并尝试在 修补它以便编译。
但即使尝试安装原始获取的 gem,也会失败,如下所示:
[ me@s390x ]$ sudo gem fetch ferret
Downloaded ferret-0.11.6
[ me@s390x ]$ sudo gem install -lV ferret-0.11.6.gem
Installing gem ferret-0.11.6
Using local gem /home/rubyusr/rubygems/gems/cache/ferret-0.11.6.gem
/home/rubyusr/rubygems/gems/gems/ferret-0.11.6/bin
ERROR: While executing gem ... (Errno::EEXIST)
File exists - /home/rubyusr/rubygems/gems/gems/ferret-0.11.6/bin
在运行此命令之前,与“ferret”相关的上述目录或文件都不存在。
同样奇怪的是 /home/rubyusr/rubygems/gems/gems/ferret-0.11.6/bin
是一个目录,尽管这可能是一个正常的抱怨。
最后一个复杂的因素是,当我运行 gem 命令时,我实际上正在运行一个 shell 脚本,该脚本为我不寻常的 rubygems 目录设置环境变量(到目前为止,我的设置还没有遇到任何问题) 。这是我的 gem
shell 脚本:
#!/bin/bash
export GEM_HOME=/home/rubyusr/rubygems/gems
export GEM_PREFIX=/home/rubyusr/rubygems
export RUBYLIB=$GEM_PREFIX/lib:/usr/lib/ruby:/usr/lib/ruby/site_ruby:/usr/lib/site_ruby
export GEM_PATH=$GEM_HOME
OUR_GEM_COMMAND=$GEM_PREFIX/bin/gem
$OUR_GEM_COMMAND $@
编辑:
我忘记补充一点,通常运行 gem install 命令似乎不会导致此错误(但 ferret 无法编译),出现错误:
posh.h:515:4: error: #error POSH cannot determine target CPU
I am trying to install the ferret
ruby gem on a RHEL zlinux (s390x architecture) machine, and am trying to install a .gem
file after patching it so that it will compile.
But even trying to install the pristine fetched gem, it fails as follows:
[ me@s390x ]$ sudo gem fetch ferret
Downloaded ferret-0.11.6
[ me@s390x ]$ sudo gem install -lV ferret-0.11.6.gem
Installing gem ferret-0.11.6
Using local gem /home/rubyusr/rubygems/gems/cache/ferret-0.11.6.gem
/home/rubyusr/rubygems/gems/gems/ferret-0.11.6/bin
ERROR: While executing gem ... (Errno::EEXIST)
File exists - /home/rubyusr/rubygems/gems/gems/ferret-0.11.6/bin
None of the above-mentioned directories or files related to "ferret" existed before running this command.
Also strange is that /home/rubyusr/rubygems/gems/gems/ferret-0.11.6/bin
is a directory, although maybe that is a normal complaint.
A final complicating factor is when I run the gem
command I am actually running a shell script that sets the environment variables for my unusual rubygems directory (I haven't had any problems so far with this set up). Here is my gem
shell script:
#!/bin/bash
export GEM_HOME=/home/rubyusr/rubygems/gems
export GEM_PREFIX=/home/rubyusr/rubygems
export RUBYLIB=$GEM_PREFIX/lib:/usr/lib/ruby:/usr/lib/ruby/site_ruby:/usr/lib/site_ruby
export GEM_PATH=$GEM_HOME
OUR_GEM_COMMAND=$GEM_PREFIX/bin/gem
$OUR_GEM_COMMAND $@
EDIT:
I forgot to add that running the gem install command normally does not seem to result in this error (but ferret fails to compile), with the error:
posh.h:515:4: error: #error POSH cannot determine target CPU
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Debian 中有一个错误要求添加对 arm64 的支持:
https://bugs.debian.org/cgi-bin/bugreport.cgi ?bug=770922
它需要在文件 ext/posh.h 中添加几行来添加对该 CPU 的支持:
添加对 s390 的支持就是添加这些行:
如果您知道 S390/X 的相应值,你可以将它们添加到那里。
There is a bug in Debian asking for adding support for arm64:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=770922
It needs adding a few lines in the file ext/posh.h to add support for that CPU:
Adding support for s390 was about adding these lines:
if you know the corresponding values for S390/X, you can add them in there.