3

我正在使用捆绑器:path => '/path/to/gem'的功能来构建和使用修改后的上游 gem,它Rake::FileList在其 .gemspec 中使用。

在这个阶段,我正在安装的捆绑包尚未激活,或者可能是安装顺序禁止捆绑器使用rake.

我正在使用红宝石 1.8.7。

我的宝石文件:

source 'http://rubygems.org'

gem "rake"
gem "foreign_gem", :path => '/home/user/src/foreign_gem'

我得到的错误:

$ bundle install
Unfortunately, a fatal error has occurred. Please see the Bundler 
troubleshooting documentation at http://bit.ly/bundler-issues. Thanks! 
/home/ilya/src/foreign_gem/foreign_gem.gemspec:11: uninitialized constant FileList (NameError)
        from /home/user/.rbenv/versions/1.8.7-p358/lib/ruby/site_ruby/1.8/rubygems/specification.rb:426:in 'initialize'
        from /home/user/src/foreign_gem/foreign_gem.gemspec:1:in 'new'
        from /home/user/src/foreign_gem/foreign_gem.gemspec:1
4

1 回答 1

3

您应该能够在文件require 'rake'顶部添加foreign_gem.gemspec以使用FileList.

我不知道这是否是最佳做法,但它应该有效。

于 2013-06-05T20:23:49.263 回答