7

Following these easy steps:

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

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

And then in my Gemfile I add this line :

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

But it fails when I run 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)'

I believe this is because there is no gemspec file located in the gem. Is there a way to build one for it ?

Anyone know a way to get around this ?

Trip
  • 26,756
  • 46
  • 158
  • 277
  • Is the vendored gem in vendor/gems/spree_easy_contact-1.0.2 ? For me, it's normally without the version numbers... so I'd expect vendor/gems/spree_easy_contact – Jesse Wolgamott Feb 11 '11 at 16:10
  • Someone said if you don't specify the version it won't create a gemspec file. I tried it both ways to no avail. Strange as it is though that Bundler can install it from the Gems directory without the gemspec file. So there maybe true to what you're saying. – Trip Feb 11 '11 at 16:16
  • And is there a gemspec file? something like spree_easy_contact.gemspec? – Jesse Wolgamott Feb 11 '11 at 16:31
  • No there isn't. I'm trying to forge one now by copying and pasting Wirble and changing its values, but it doesn't believe me. – Trip Feb 11 '11 at 16:35

2 Answers2

12

I forgot to leave the version out on my Gem! Super important :

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

Also it was strange..this Gem also require honeypot-captcha, so I had to include that in my Gemfile. All is well.

Trip
  • 26,756
  • 46
  • 158
  • 277
  • 1
    This worked for me as well! I edited my Gemfile and appended a version number to the gem folder name. Also, it seems ok without the complicated path: gem 'streama', '0.3.2', path: 'vendor/gems/streama-0.3.2' – Peter Ehrlich Jan 11 '12 at 05:42
0

You can try this solution:

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

macarthy
  • 3,074
  • 2
  • 23
  • 24
  • A recursive error. Because there is no gemspec, if I run rake gemspec:generate, it tells me I need to run 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)' Try running `bundle install`.` – Trip Feb 11 '11 at 16:15