我有一个用于coffeescript测试的RAILS插件
https://github.com/bradphelan/jasminerice
其中的gemspec定义为
# Provide a simple gemspec so you can easily use your
# project in your rails apps through git.
Gem::Specification.new do |s|
s.name = "jasminerice"
s.summary = "Pain free coffeescript unit testing for Rails 3.1 using jasmine"
s.description = "Full support for the Rails 3.1 asset pipeline when bdd'ing your coffeescript or javascript using jasmine"
s.files = `git ls-files`.split "\n"
s.authors = ["Brad Phelan"]
s.version = "0.0.6"
s.platform = Gem::Platform::RUBY
s.add_dependency( 'haml' )
end在底部,我添加了haml依赖项。如果jasminerice包含在客户端Gemfile中,则为
gem 'jasminerice'然后它失败了,因为没有包含'haml‘。如果将haml显式包含为
gem 'jasminerice'
gem 'haml'然后一切都好了。这与我对Gemfiles和gemspecs的理解不符。有没有明显的我遗漏了什么。
发布于 2011-08-29 22:52:02
我想你的gem Gemfile中遗漏了一行gemspec代码。
来自http://yehudakatz.com/2010/12/16/clarifying-the-roles-of-the-gemspec-and-gemfile/:
在开发gem时,请在Gemfile中使用
gemspec方法,以避免重复。一般来说,gem的Gemfile应该包含Rubygems源代码和一行gemspec代码。
https://stackoverflow.com/questions/6826235
复制相似问题