7

遵循这些简单的步骤:

gem unpack spree_easy_contact -v 1.0.2 --target vendor/gems

Unpacked gem: '../vendor/gems/spree_easy_contact-1.0.2'

然后在我的 Gemfile 中添加这一行:

gem "spree_easy_contact", :path => "vendor/gems/spree_easy_contact-1.0.2"

但是当我运行时它失败了bundle install

Could not find gem 'spree_easy_contact (>= 0, runtime)' in source at vendor/gems/spree_easy_contact-1.0.2.
Source does not contain any versions of 'spree_easy_contact (>= 0, runtime)'

我相信这是因为 gem 中没有 gemspec 文件。有没有办法为它建造一个?

有人知道解决这个问题的方法吗?

4

2 回答 2

12

我忘了把版本留在我的宝石上!超级重要:

gem "spree_easy_contact", '1.0.2', :path => "#{File.expand_path(__FILE__)}/../vendor/gems/spree_easy_contact-1.0.2"

也很奇怪..这个 Gem 还需要蜜罐验证码,所以我必须将它包含在我的 Gemfile 中。一切都很好。

于 2011-02-11T16:44:11.000 回答
0

你可以试试这个解决方案:

http://makandra.com/notes/538-freeze-vendor-unpack-a-single-ruby-gem-with-and-without-bundler

于 2011-02-11T16:12:39.267 回答