Ruby 如何使用已捆绑为独立的gem?

Ruby 如何使用已捆绑为独立的gem?,ruby,rubygems,Ruby,Rubygems,我无法控制安装在Jenkins CI服务器上的gems,因此我需要从源目录中运行 我使用“bundle--standalone”将slather打包成一个包含所有依赖项的自包含单元 现在我陷入了如何从另一个Ruby脚本调用slather的困境。Slather是一个从LLVM数据文件生成覆盖率报告的应用程序。现在,我有了如下所示的目录结构,正确地安装了依赖项,并将其放在ruby bin目录中 slather ├── bundler └── ruby └── 2.0.0 ├─

我无法控制安装在Jenkins CI服务器上的gems,因此我需要从源目录中运行

我使用“bundle--standalone”将slather打包成一个包含所有依赖项的自包含单元

现在我陷入了如何从另一个Ruby脚本调用slather的困境。Slather是一个从LLVM数据文件生成覆盖率报告的应用程序。现在,我有了如下所示的目录结构,正确地安装了依赖项,并将其放在ruby bin目录中

slather
├── bundler
└── ruby
    └── 2.0.0
        ├── bin
        ├── build_info
        ├── cache
        ├── gems
        │   ├── CFPropertyList-2.3.5
        │   │   └── lib
        │   │       └── cfpropertylist
        │   ├── activesupport-4.2.8
        │   │   └── lib
        │   │       └── active_support
        │   │           ├── cache
        │   │           │   └── strategy
        │   │           ├── concurrency
        │   │           ├── core_ext
        │   │           │   ├── array
        │   │           │   ├── big_decimal
        │   │           │   ├── class
        │   │           │   ├── date
        │   │           │   ├── date_and_time
        │   │           │   ├── date_time
        │   │           │   ├── digest
        │   │           │   ├── file
        │   │           │   ├── hash
        │   │           │   ├── integer
        │   │           │   ├── kernel
        │   │           │   ├── module
        │   │           │   ├── numeric
        │   │           │   ├── object
        │   │           │   ├── range
        │   │           │   ├── string
        │   │           │   └── time
        │   │           ├── dependencies
        │   │           ├── deprecation
        │   │           ├── inflector
        │   │           ├── json
        │   │           ├── locale
        │   │           ├── log_subscriber
        │   │           ├── multibyte
        │   │           ├── notifications
        │   │           ├── number_helper
        │   │           ├── testing
        │   │           ├── values
        │   │           └── xml_mini
        │   ├── claide-1.0.2
        │   │   └── lib
        │   │       └── claide
        │   │           ├── ansi
        │   │           └── command
        │   ├── clamp-0.6.5
        │   │   ├── examples
        │   │   ├── lib
        │   │   │   └── clamp
        │   │   │       ├── attribute
        │   │   │       ├── option
        │   │   │       ├── parameter
        │   │   │       └── subcommand
        │   │   └── spec
        │   │       └── clamp
        │   │           ├── option
        │   │           └── parameter
        │   ├── colored2-3.1.2
        │   │   ├── lib
        │   │   │   └── colored2
        │   │   └── spec
        │   │       └── colored2
        │   ├── i18n-0.8.4
        │   │   ├── gemfiles
        │   │   ├── lib
        │   │   │   └── i18n
        │   │   │       ├── backend
        │   │   │       ├── core_ext
        │   │   │       │   ├── kernel
        │   │   │       │   └── string
        │   │   │       ├── gettext
        │   │   │       ├── interpolate
        │   │   │       ├── locale
        │   │   │       │   └── tag
        │   │   │       └── tests
        │   │   │           └── localization
        │   │   └── test
        │   │       ├── api
        │   │       ├── backend
        │   │       ├── core_ext
        │   │       ├── gettext
        │   │       ├── i18n
        │   │       ├── locale
        │   │       │   └── tag
        │   │       └── test_data
        │   │           └── locales
        │   │               └── invalid
        │   ├── mini_portile2-2.1.0
        │   │   ├── lib
        │   │   │   └── mini_portile2
        │   │   └── test
        │   │       └── assets
        │   │           ├── git
        │   │           └── test\ mini\ portile-1.0.0
        │   ├── minitest-5.10.2
        │   │   ├── lib
        │   │   │   ├── hoe
        │   │   │   └── minitest
        │   │   └── test
        │   │       └── minitest
        │   ├── nanaimo-0.2.3
        │   │   ├── bin
        │   │   └── lib
        │   │       └── nanaimo
        │   │           ├── unicode
        │   │           └── writer
        │   ├── nokogiri-1.6.8.1
        │   │   ├── bin
        │   │   ├── ext
        │   │   │   └── nokogiri
        │   │   ├── lib
        │   │   │   ├── nokogiri
        │   │   │   │   ├── css
        │   │   │   │   ├── decorators
        │   │   │   │   ├── html
        │   │   │   │   │   └── sax
        │   │   │   │   ├── xml
        │   │   │   │   │   ├── node
        │   │   │   │   │   ├── pp
        │   │   │   │   │   ├── sax
        │   │   │   │   │   └── xpath
        │   │   │   │   └── xslt
        │   │   │   └── xsd
        │   │   │       └── xmlparser
        │   │   ├── patches
        │   │   ├── suppressions
        │   │   ├── tasks
        │   │   └── test
        │   │       ├── css
        │   │       ├── decorators
        │   │       ├── files
        │   │       │   ├── bar
        │   │       │   ├── foo
        │   │       │   ├── saml
        │   │       │   └── test_document_url
        │   │       ├── html
        │   │       │   └── sax
        │   │       ├── namespaces
        │   │       ├── xml
        │   │       │   ├── node
        │   │       │   └── sax
        │   │       └── xslt
        │   ├── thread_safe-0.3.6
        │   │   ├── examples
        │   │   ├── ext
        │   │   │   ├── org
        │   │   │   │   └── jruby
        │   │   │   │       └── ext
        │   │   │   │           └── thread_safe
        │   │   │   │               ├── jsr166e
        │   │   │   │               │   └── nounsafe
        │   │   │   │               └── jsr166y
        │   │   │   └── thread_safe
        │   │   ├── lib
        │   │   │   └── thread_safe
        │   │   │       └── util
        │   │   ├── spec
        │   │   │   ├── src
        │   │   │   │   └── thread_safe
        │   │   │   ├── support
        │   │   │   └── thread_safe
        │   │   ├── tasks
        │   │   └── yard-template
        │   │       └── default
        │   │           ├── fulldoc
        │   │           │   └── html
        │   │           │       └── css
        │   │           └── layout
        │   │               └── html
        │   ├── tzinfo-1.2.3
        │   │   ├── lib
        │   │   │   └── tzinfo
        │   │   └── test
        │   │       ├── tzinfo-data
        │   │       │   └── tzinfo
        │   │       │       └── data
        │   │       │           ├── definitions
        │   │       │           │   ├── America
        │   │       │           │   │   └── Argentina
        │   │       │           │   ├── Australia
        │   │       │           │   ├── Etc
        │   │       │           │   └── Europe
        │   │       │           └── indexes
        │   │       └── zoneinfo
        │   │           ├── America
        │   │           │   └── Argentina
        │   │           ├── Australia
        │   │           ├── Etc
        │   │           ├── Europe
        │   │           ├── posix
        │   │           │   └── Europe
        │   │           └── right
        │   │               └── Europe
        │   └── xcodeproj-1.5.0
        │       ├── bin
        │       └── lib
        │           └── xcodeproj
        │               ├── command
        │               ├── config
        │               ├── project
        │               │   └── object
        │               │       └── helpers
        │               ├── scheme
        │               └── workspace
        └── specifications
我需要从另一个目录给slather打电话。我尝试了以下方法,但没有成功

ruby -r ../../slather/bundler/setup.rb ../../slather/ruby/2.0.0/bin/slather
这会产生以下错误:

ruby -r ../../slather/bundler/setup.rb ../../slather/ruby/2.0.0/bin/slather
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/dependency.rb:296:in `to_specs': Could not find 'slather' (>= 0) among 19 total gem(s) (Gem::LoadError)
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/dependency.rb:307:in `to_spec'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_gem.rb:47:in `gem'
from ../../slather/ruby/2.0.0/bin/slather:22:in `<main>'
这部分似乎工作正常,我相信它正在从setup.rb文件加载设置。Ruby不是我的强项,所以我很难想出如何在Ruby脚本或bash脚本中调用slather

如果有人能告诉我如何从命令行或Ruby脚本调用slather,我将非常感谢您的帮助。我也看过omnibus,但对于我的需求来说,这似乎是相当繁重的任务

setup.rb
在slather/bundler中
slather
位于slather/ruby/2.0.0/bin目录中

slather
├── bundler
└── ruby
    └── 2.0.0
        ├── bin
        ├── build_info
        ├── cache
        ├── gems
        │   ├── CFPropertyList-2.3.5
        │   │   └── lib
        │   │       └── cfpropertylist
        │   ├── activesupport-4.2.8
        │   │   └── lib
        │   │       └── active_support
        │   │           ├── cache
        │   │           │   └── strategy
        │   │           ├── concurrency
        │   │           ├── core_ext
        │   │           │   ├── array
        │   │           │   ├── big_decimal
        │   │           │   ├── class
        │   │           │   ├── date
        │   │           │   ├── date_and_time
        │   │           │   ├── date_time
        │   │           │   ├── digest
        │   │           │   ├── file
        │   │           │   ├── hash
        │   │           │   ├── integer
        │   │           │   ├── kernel
        │   │           │   ├── module
        │   │           │   ├── numeric
        │   │           │   ├── object
        │   │           │   ├── range
        │   │           │   ├── string
        │   │           │   └── time
        │   │           ├── dependencies
        │   │           ├── deprecation
        │   │           ├── inflector
        │   │           ├── json
        │   │           ├── locale
        │   │           ├── log_subscriber
        │   │           ├── multibyte
        │   │           ├── notifications
        │   │           ├── number_helper
        │   │           ├── testing
        │   │           ├── values
        │   │           └── xml_mini
        │   ├── claide-1.0.2
        │   │   └── lib
        │   │       └── claide
        │   │           ├── ansi
        │   │           └── command
        │   ├── clamp-0.6.5
        │   │   ├── examples
        │   │   ├── lib
        │   │   │   └── clamp
        │   │   │       ├── attribute
        │   │   │       ├── option
        │   │   │       ├── parameter
        │   │   │       └── subcommand
        │   │   └── spec
        │   │       └── clamp
        │   │           ├── option
        │   │           └── parameter
        │   ├── colored2-3.1.2
        │   │   ├── lib
        │   │   │   └── colored2
        │   │   └── spec
        │   │       └── colored2
        │   ├── i18n-0.8.4
        │   │   ├── gemfiles
        │   │   ├── lib
        │   │   │   └── i18n
        │   │   │       ├── backend
        │   │   │       ├── core_ext
        │   │   │       │   ├── kernel
        │   │   │       │   └── string
        │   │   │       ├── gettext
        │   │   │       ├── interpolate
        │   │   │       ├── locale
        │   │   │       │   └── tag
        │   │   │       └── tests
        │   │   │           └── localization
        │   │   └── test
        │   │       ├── api
        │   │       ├── backend
        │   │       ├── core_ext
        │   │       ├── gettext
        │   │       ├── i18n
        │   │       ├── locale
        │   │       │   └── tag
        │   │       └── test_data
        │   │           └── locales
        │   │               └── invalid
        │   ├── mini_portile2-2.1.0
        │   │   ├── lib
        │   │   │   └── mini_portile2
        │   │   └── test
        │   │       └── assets
        │   │           ├── git
        │   │           └── test\ mini\ portile-1.0.0
        │   ├── minitest-5.10.2
        │   │   ├── lib
        │   │   │   ├── hoe
        │   │   │   └── minitest
        │   │   └── test
        │   │       └── minitest
        │   ├── nanaimo-0.2.3
        │   │   ├── bin
        │   │   └── lib
        │   │       └── nanaimo
        │   │           ├── unicode
        │   │           └── writer
        │   ├── nokogiri-1.6.8.1
        │   │   ├── bin
        │   │   ├── ext
        │   │   │   └── nokogiri
        │   │   ├── lib
        │   │   │   ├── nokogiri
        │   │   │   │   ├── css
        │   │   │   │   ├── decorators
        │   │   │   │   ├── html
        │   │   │   │   │   └── sax
        │   │   │   │   ├── xml
        │   │   │   │   │   ├── node
        │   │   │   │   │   ├── pp
        │   │   │   │   │   ├── sax
        │   │   │   │   │   └── xpath
        │   │   │   │   └── xslt
        │   │   │   └── xsd
        │   │   │       └── xmlparser
        │   │   ├── patches
        │   │   ├── suppressions
        │   │   ├── tasks
        │   │   └── test
        │   │       ├── css
        │   │       ├── decorators
        │   │       ├── files
        │   │       │   ├── bar
        │   │       │   ├── foo
        │   │       │   ├── saml
        │   │       │   └── test_document_url
        │   │       ├── html
        │   │       │   └── sax
        │   │       ├── namespaces
        │   │       ├── xml
        │   │       │   ├── node
        │   │       │   └── sax
        │   │       └── xslt
        │   ├── thread_safe-0.3.6
        │   │   ├── examples
        │   │   ├── ext
        │   │   │   ├── org
        │   │   │   │   └── jruby
        │   │   │   │       └── ext
        │   │   │   │           └── thread_safe
        │   │   │   │               ├── jsr166e
        │   │   │   │               │   └── nounsafe
        │   │   │   │               └── jsr166y
        │   │   │   └── thread_safe
        │   │   ├── lib
        │   │   │   └── thread_safe
        │   │   │       └── util
        │   │   ├── spec
        │   │   │   ├── src
        │   │   │   │   └── thread_safe
        │   │   │   ├── support
        │   │   │   └── thread_safe
        │   │   ├── tasks
        │   │   └── yard-template
        │   │       └── default
        │   │           ├── fulldoc
        │   │           │   └── html
        │   │           │       └── css
        │   │           └── layout
        │   │               └── html
        │   ├── tzinfo-1.2.3
        │   │   ├── lib
        │   │   │   └── tzinfo
        │   │   └── test
        │   │       ├── tzinfo-data
        │   │       │   └── tzinfo
        │   │       │       └── data
        │   │       │           ├── definitions
        │   │       │           │   ├── America
        │   │       │           │   │   └── Argentina
        │   │       │           │   ├── Australia
        │   │       │           │   ├── Etc
        │   │       │           │   └── Europe
        │   │       │           └── indexes
        │   │       └── zoneinfo
        │   │           ├── America
        │   │           │   └── Argentina
        │   │           ├── Australia
        │   │           ├── Etc
        │   │           ├── Europe
        │   │           ├── posix
        │   │           │   └── Europe
        │   │           └── right
        │   │               └── Europe
        │   └── xcodeproj-1.5.0
        │       ├── bin
        │       └── lib
        │           └── xcodeproj
        │               ├── command
        │               ├── config
        │               ├── project
        │               │   └── object
        │               │       └── helpers
        │               ├── scheme
        │               └── workspace
        └── specifications

哦,我看到了别的东西。slather/ruby/2.0.0/bin中的
slather
是slather周围的某种类型的包装器。哦,我看到了其他东西。slather/ruby/2.0.0/bin中的
slather
是slather周围的某种类型的包装器。