0
私はbundlelerでgemを作成し、すべてのルビファイルをドキュメントとして「/ lib」に入れました。 しかし、私は後ので、私はそれを使用することはできません「すくいビルド」コマンドとインストール(GEMがPKG /宝石をインストール)宝石の構築、問題を抱えている:メインファイルに私がしようとしているため、これが原因であるgemで必要とされない
LoadError: cannot load such file -- mygem/client
をlibに/ mygem/client.rb である 'mygem/client.rb' を必要とし、それが動作しませんされています。あなたのメインのファイルがあると仮定すると、
# coding: utf-8
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'diggy/version'
Gem::Specification.new do |spec|
spec.name = "diggy"
spec.version = Diggy::VERSION
spec.authors = [""]
spec.email = [""]
spec.summary = %q{: Write a short summary, because Rubygems requires one.}
spec.description = %q{: Write a longer description or delete this line.}
spec.homepage = ""
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
# to allow pushing to a single host or delete this section to allow pushing to any host.
if spec.respond_to?(:metadata)
spec.metadata['allowed_push_host'] = "TODO: Set to 'http://mygemserver.com'"
else
raise "RubyGems 2.0 or newer is required to protect against " \
"public gem pushes."
end
spec.files = `git ls-files -z`.split("\x0")
spec.bindir = "exe"
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
spec.require_paths = ["lib"]
spec.add_development_dependency "bundler", "~> 1.14"
spec.add_development_dependency "rake", "~> 10.0"
end
'gem contents mygem'(この場合は' gem contents diggy')と 'git status'(gems開発ディレクトリ内から)の結果を追加できますか? – matt