【发布时间】:2017-06-26 16:02:12
【问题描述】:
我不得不从 github 分叉一个 gem,并进行一些代码更改以满足我的需要。然后我使用this resource 将其放入我自己的github repo。
现在,对于我的应用,我已将 gem 添加到我的 Gemfile:
source 'https://rubygems.org'
gem 'openvas-omp', :git => 'git://github.com/godzilla74/openvas-omp-ruby.git'
运行bundle install,现在我正在尝试运行我的应用程序,但它抛出一个错误,说它无法加载我的 gem:
/Users/godzilla74/.rbenv/versions/2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- openvas-omp-ruby (LoadError)
from /Users/godzilla74/.rbenv/versions/2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from omp.rb:7:in `<main>'
到目前为止,我的应用程序非常简单。只是一个文件omp.rb:
...some other requires....
require 'openvas-omp'
ov = OpenVASOMP::OpenVASOMP.new("host" => "10.10.10.200", "port" => "9390", "user" => 'admin', "password" => 'admin')
puts ov
这是我当前的 omp 应用文件夹树:
.
├── Gemfile
├── Gemfile.lock
├── omp.rb
我是否错误地实施了 gem?据我了解,我不能简单地运行命令gem install openvas-omp,因为这会在我分叉的原始 github 存储库中继续。
【问题讨论】:
-
您是否使用 bundler exec 运行应用程序,即 bundle exec rails s
-
bundle exec omp.rb->bundler: command not found: omp.rb
标签: ruby-on-rails ruby github rubygems