Я довольно новичок в ruby и пытаюсь написать файл гемов, но возникает следующая ошибка. Я обновил упаковщик и соответствующие гемы, как было предложено в других постах. Разработка с
- Ubuntu 18.04LTS
- ruby 2.5.1p57
- gem 3.1.2
Traceback (most recent call last):
15: from /usr/local/bin/vcdm:23:in `<main>'
14: from /usr/local/bin/vcdm:23:in `load'
13: from /var/lib/gems/2.5.0/gems/vcdm-0.1.2/bin/vcdm:4:in `<top (required)>'
12: from /usr/local/lib/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:72:in `require'
11: from /usr/local/lib/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:72:in `require'
10: from /var/lib/gems/2.5.0/gems/vcdm-0.1.2/lib/vcdm.rb:2:in `<top (required)>'
9: from /usr/local/lib/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:72:in `require'
8: from /usr/local/lib/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:72:in `require'
7: from /var/lib/gems/2.5.0/gems/vcdm-0.1.2/lib/vcdm/command.rb:1:in `<top (required)>'
6: from /var/lib/gems/2.5.0/gems/vcdm-0.1.2/lib/vcdm/command.rb:4:in `<module:Vcdm>'
5: from /var/lib/gems/2.5.0/gems/vcdm-0.1.2/lib/vcdm/command.rb:4:in `glob'
4: from /usr/local/lib/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:92:in `require'
3: from /usr/local/lib/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:92:in `require'
2: from /var/lib/gems/2.5.0/gems/vcdm-0.1.2/lib/vcdm/commands/hostfile.rb:4:in `<top (required)>'
1: from /var/lib/gems/2.5.0/gems/vcdm-0.1.2/lib/vcdm/commands/hostfile.rb:5:in `<module:Vcdm>'
/var/lib/gems/2.5.0/gems/vcdm-0.1.2/lib/vcdm/commands/hostfile.rb:14:in `<class:HostfileCommand>': uninitialized constant Vcdm::HostfileCommand::CommandOption (NameError)
Это мой код, что я пытаюсь выполнить command_option.rb
module Vcdm
class CommandOption
attr_reader :name, :type, :description
def initialize(name, type, description)
@name = name
@type = type
@description = description
end
end
end
hostfile.rb
require 'vcdm/command_interface'
module Vcdm
class HostfileCommand
as = CommandOption.new("--path STRING", String, "custom hosts path")
IS_PUBLIC_COMMAND = true
SYNTAX = 'vcdm hostfile'
SUMMARY = 'adds the ingress url to the users hostfile'
DESCRIPTION = ""
EXAMPLE = "vcdm hostfile --path=/mnt/c/Windows/System32/drivers/etc/hosts"
EXAMPLE_DESCRIPTION = ""
implements CommandInterface
end
end
command_interface.rb
require 'class_interface'
class CommandInterface
IS_PUBLIC_COMMAND = true | false
SYNTAX = String
SUMMARY = String
DESCRIPTION = String
EXAMPLE = String
EXAMPLE_DESCRIPTION = String
OPTIONS = Array
def initialize
end
def execute(args, options)
end
end
Что-то не так?