ruby gem require_relative cannot load such file -
i've looked around online , on , of answers question should using require_relative
using don't know problem might be. i'm trying build ruby gem , folder structure looks this
--xmlmc-rb/ --lib/ --xmlmc-rb/ api.rb interface.rb version.rb xmlmc-rb.rb
within xmlmc-rb.rb
requiring 3 of files under xmlmc-rb/
directory this
require_relative "xmlmc-rb/version" require_relative "xmlmc-rb/interface" require_relative "xmlmc-rb/api" require 'net/http' require 'nokogiri' require 'base64'
but keep getting error
/library/ruby/gems/2.0.0/gems/xmlmc-rb-0.1.1/lib/xmlmc-rb.rb:2:in `require_relative': cannot load such file -- /library/ruby/gems/2.0.0/gems/xmlmc-rb-0.1.1/lib/xmlmc-rb/interface (loaderror) /library/ruby/gems/2.0.0/gems/xmlmc-rb-0.1.1/lib/xmlmc-rb.rb:2:in `<top (required)>' /library/ruby/site/2.0.0/rubygems/core_ext/kernel_require.rb:128:in `require' /library/ruby/site/2.0.0/rubygems/core_ext/kernel_require.rb:128:in `rescue in require' /library/ruby/site/2.0.0/rubygems/core_ext/kernel_require.rb:39:in `require' xmlmc_test.rb:1:in `<main>'
when manually copy files main rb file works. thought naming error since casing of files under xmlmc-rb/
weren't uniform, fixed that, made them lowercase names , same error persists.
as didn't understand gem name, show how did:
require "password_control/scrypt/scrypthash"
in case have directory inside password_control folder. if file in password_control directory, require be:
require "password_control/scrypthash"
Comments
Post a Comment