使用rubygems和rvm“无法加载此类文件”

时间:2021-12-06 07:16:18

I develop a package called CodeRunner that has a number of add-on package (CodeRunner modules, all with names like ...crmod). One of these is called trinitycrmod.

我开发了一个名为CodeRunner的包,它包含许多附加包(CodeRunner模块,所有模块都有... crmod等名称)。其中一个叫做trinitycrmod。

On Debian stable (wheezy), I have installed RVM using the standard instructions. My .bashrc is setup correctly: the final line is:

在Debian stable(wheezy)上,我使用标准指令安装了RVM。我的.bashrc设置正确:最后一行是:

[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"

I am using Ruby 2.1.0 (but this error can be reproduced with 1.9.3)

我使用的是Ruby 2.1.0(但这个错误可以用1.9.3复制)

rvm use 2.1

I have installed CodeRunner and trinitycrmod:

我安装了CodeRunner和trinitycrmod:

gem install coderunner
gem install trinitycrmod

Now the CodeRunner gem contains the tool coderunner. One of coderunner's commands is called ex, and it evaluates the ruby fragment you give the command. I want to load trinitycrmod.

现在CodeRunner gem包含工具coderunner。 coderunner的一个命令叫做ex,它会评估你给命令的ruby片段。我想加载trinitycrmod。

coderunner ex ' require "trinitycrmod"'

But I get an error when loading the file (which is part of the installed gem).

但是我在加载文件时遇到错误(这是已安装的gem的一部分)。

.rvm/gems/ruby-2.1.0/gems/coderunner-0.13.32/lib/coderunner.rb:118:in `require': cannot load such file -- trinitycrmod (LoadError)

.rvm / gems / ruby​​-2.1.0 / gems / coderunner-0.13.32 / lib / coderunner.rb:118:在`require':无法加载这样的文件--trinitycrmod(LoadError)

I don't get this error if I use ruby directly....

如果我直接使用ruby,我不会收到此错误....

ruby `which coderunner` ex ' require "trinitycrmod"'

runs fine. I also don't get this error if I use the system ruby:

运行正常。如果我使用系统ruby,我也不会收到此错误:

rvm use system
coderunner ex ' require "trinitycrmod"'

I also don't get this error if I edit the coderunner bin file and replace ruby_executable_hooks with plain ruby:

如果我编辑coderunner bin文件并用ruby替换ruby_executable_hooks,我也不会收到此错误:

sed -i s/ruby_executable_hooks/ruby/ `which coderunner`

This makes me think that it has to be an error with ruby gems and/or rvm and not my mistake, particularly as this code is all at least 6 months old and has worked fine up till now.

这让我认为它必须是ruby gems和/或rvm的错误,而不是我的错误,特别是因为这段代码至少已经有6个月的历史并且到目前为止一直很好。

PS My gem environment seems to be just fine....

PS我的宝石环境似乎很好....

  • RUBYGEMS VERSION: 2.2.1
    • RUBY VERSION: 2.1.0 (2013-12-25 patchlevel 0) [x86_64-linux]
    • RUBY版本:2.1.0(2013-12-25补丁级别0)[x86_64-linux]
    • INSTALLATION DIRECTORY: /home/edmundhighcock/.rvm/gems/ruby-2.1.0
    • 安装目录:/home/edmundhighcock/.rvm/gems/ruby-2.1.0
    • RUBY EXECUTABLE: /home/edmundhighcock/.rvm/rubies/ruby-2.1.0/bin/ruby
    • RUBY EXECUTABLE:/home/edmundhighcock/.rvm/rubies/ruby-2.1.0/bin/ruby
    • EXECUTABLE DIRECTORY: /home/edmundhighcock/.rvm/gems/ruby-2.1.0/bin
    • 可执行的目录:/home/edmundhighcock/.rvm/gems/ruby-2.1.0/bin
    • SPEC CACHE DIRECTORY: /home/edmundhighcock/.gem/specs
    • SPEC CACHE目录:/home/edmundhighcock/.gem/specs
    • RUBYGEMS PLATFORMS:
    • RUBYGEMS PLATFORMS:
    • ruby
    • 红宝石
    • x86_64-linux
    • x86_64的Linux的
    • GEM PATHS:
      • /home/edmundhighcock/.rvm/gems/ruby-2.1.0
      • /home/edmundhighcock/.rvm/gems/ruby-2.1.0
      • /home/edmundhighcock/.rvm/gems/ruby-2.1.0@global
      • /home/edmundhighcock/.rvm/gems/ruby-2.1.0@global
    • GEM路径:/home/edmundhighcock/.rvm/gems/ruby-2.1.0 /home/edmundhighcock/.rvm/gems/ruby-2.1.0@global
    • GEM CONFIGURATION:
      • :update_sources => true
      • :update_sources => true
      • :verbose => true
      • :verbose => true
      • :backtrace => false
      • :backtrace => false
      • :bulk_threshold => 1000
      • :bulk_threshold => 1000
    • GEM CONFIGURATION :: update_sources => true:verbose => true:backtrace => false:bulk_threshold => 1000
    • REMOTE SOURCES:
    • 远程来源:https://rubygems.org/
    • SHELL PATH:
      • /home/edmundhighcock/.rvm/gems/ruby-2.1.0/bin
      • /home/edmundhighcock/.rvm/gems/ruby-2.1.0/bin
      • /home/edmundhighcock/.rvm/gems/ruby-2.1.0@global/bin
      • /home/edmundhighcock/.rvm/gems/ruby-2.1.0@global/bin
      • /home/edmundhighcock/.rvm/rubies/ruby-2.1.0/bin
      • /home/edmundhighcock/.rvm/rubies/ruby-2.1.0/bin
      • /home/edmundhighcock/.rvm/bin
      • /home/edmundhighcock/.rvm/bin
      • /home/edmundhighcock/Code/scripts
      • /家庭/ edmundhighcock /代码/脚本
      • /usr/local/bin
      • 在/ usr / local / bin目录
      • /usr/bin
      • 在/ usr / bin中
      • /bin
      • /箱
      • /usr/local/games
      • 在/ usr /本地/游戏
      • /usr/games
      • 在/ usr /游戏
    • SHELL PATH:/home/edmundhighcock/.rvm/gems/ruby-2.1.0/bin /home/edmundhighcock/.rvm/gems/ruby-2.1.0@global/bin /home/edmundhighcock/.rvm/rubies/ruby -2.1.0 / bin /home/edmundhighcock/.rvm/bin / home / edmundhighcock / Code / scripts / usr / local / bin / usr / bin / bin / usr / local / games / usr / games
  • RUBYGEMS版本:2.2.1 RUBY版本:2.1.0(2013-12-25 patchlevel 0)[x86_64-linux]安装目录:/home/edmundhighcock/.rvm/gems/ruby-2.1.0 RUBY EXECUTABLE:/ home / edmundhighcock / .rvm / rubies / ruby​​-2.1.0 / bin / ruby​​ EXECUTABLE DIRECTORY:/home/edmundhighcock/.rvm/gems/ruby-2.1.0/bin SPEC CACHE目录:/home/edmundhighcock/.gem/specs RUBYGEMS平台:ruby x86_64-linux GEM路径:/home/edmundhighcock/.rvm/gems/ruby-2.1.0 /home/edmundhighcock/.rvm/gems/ruby-2.1.0@global GEM配置:: update_sources => true: verbose => true:backtrace => false:bulk_threshold => 1000 REMOTE SOURCES:https://rubygems.org/ SHELL PATH:/home/edmundhighcock/.rvm/gems/ruby-2.1.0/bin / home / edmundhighcock / .rvm / gems / ruby​​-2.1.0 @ global / bin /home/edmundhighcock/.rvm/rubies/ruby-2.1.0/bin /home/edmundhighcock/.rvm/bin / home / edmundhighcock / Code / scripts / usr / local / bin / usr / bin / bin / usr / local / games / usr / games

1 个解决方案

#1


0  

the error message simply states that trinitycrmod gem is not installed correctly, run gem list command and check whether the trinitycrmod gem is installed or not in your current gemset?

错误消息只是声明没有正确安装trinitycrmod gem,运行gem list命令并检查当前gemset中是否安装了trinitycrmod gem?

#1


0  

the error message simply states that trinitycrmod gem is not installed correctly, run gem list command and check whether the trinitycrmod gem is installed or not in your current gemset?

错误消息只是声明没有正确安装trinitycrmod gem,运行gem list命令并检查当前gemset中是否安装了trinitycrmod gem?