2013-05-20 48 views
0

這裏只有一個錯誤安裝我的自定義的寶石時,我得到:File not found: lib ERROR: While generating documentation創業板安裝不創建的lib/

安裝繼續,並說gem installed successfully。但是,當我require 'boxes'我得到LoadError: no such file to load -- boxes,並且當我查看gem目錄時,我注意到已安裝的gem中沒有lib/文件夾。我不知道爲什麼這是或如何調試它。任何指針?以下是我的gemspec文件。

# -*- encoding: utf-8 -*- 
lib = File.expand_path('../lib', __FILE__) 
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) 
require 'boxes/version' 

Gem::Specification.new do |gem| 
    gem.authors  = ["Name"] 
    gem.email   = ["http://somedomain.com"] 
    gem.description = %q{Boxes, a Sass framework} 
    gem.summary  = %q{Boxes is a modular Sass-based framework that is heavily configurable, extremely modular and works as a Sass and a CSS Framework} 
    gem.homepage  = "http://somedomain.com" 

    gem.files   = `git ls-files`.split($\) 
    gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) } 
    gem.test_files = gem.files.grep(%r{^(test|spec|features)/}) 
    gem.name   = "boxes" 
    gem.require_paths = ["lib"] 
    gem.version  = Boxes::VERSION 
    gem.license  = "MIT" 

    gem.add_dependency "sass", [">= 3.2.0"] 
    gem.add_development_dependency "rake" 
end 

我是紅寶石新手,我只是在這裏創建我的第一個寶石,所以請耐心等待。

回答

1

我注意到的一件事是,在第1行中,您將「lib」定義爲「../lib」,但在gem.require_paths中,「lib」位於當前目錄中。真的嗎?

另一件事是尋找,那LIB不作爲的.gitignore你使用git ls-files定義gem.files

編輯

在你的Gemfile注意到,您正在使用的紅寶石1.8.7,確保在你需要你的寶石之前你需要'rubygems'

+0

lib不會被排除,'..lib'(雖然也讓我感到困惑)是正確的,但它直接取自gemspec,bundler生成'bundle gem somegem' – nimrod

+0

對不起,只是重新讀一遍,它是正確的,因爲它會以'./ lib'結尾。我的錯。 –

+0

它將如何以./lib結尾? – nimrod