Take the 2-minute tour ×

For my application, I need to handle encrypted ZIP files. Despite their horrific looking site, it seems that Chilkat's commercial Zip gem is probably the best way to go to implement this.

Because this is a commercial gem, they don't have it in any of the typical gem sources that Bundler looks at. I was able to install the Linux 64-bit version of the gem under Mac OS X (though I haven't tried to run it yet, so no word yet on if that will actually work). However, I'm first trying to get Bundler to recognize and load the gem from the .gem file that I downloaded.

Bundler has a path attribute which I've tried to utilize in several ways, but I haven't gotten it to work yet:

  1. I tried using path to point to the .gem file itself, but path expects a directory.
  2. I tried adding .gz to the end of the .gem file and extracting it - I got a directory with a data.tar.gz and metadata.gz inside. path pointed to the extracted directory with these two files didn't work.
  3. I tried extracting the data.tar.gz and metadata.gz and placing the extracted versions inside the directory that I pointed path to. This failed.
  4. I noticed that the gem didn't have a gemspec file - I created one and placed it inside the directory. No luck.

This is the error that I get:

$ bundle install
Fetching source index for http://rubygems.org/
Fetching source index for http://gems.github.com/
Could not find gem 'chilkat (>= 0, runtime)' in source at /Users/username/appname/vendor/cache/chilkat-9.1.0-x86_64-linux.
Source does not contain any versions of 'chilkat (>= 0, runtime)'

Any ideas on how I can get Bundler to see that the gem is indeed in this directory? Any other options other than the path attribute which doesn't seem to be working?

Many thanks!

share|improve this question
Could you build a gem around it, requiring the .gem file, with a proper gemspec? –  aceofspades Apr 29 '11 at 18:32
add comment

5 Answers

up vote 48 down vote accepted

I'm using Rails 3.0.3, new to Rails 3 and bundler.

I got this same error with:

gem 'mygem', :path => '/path/to/gem'

Resolved by specifying the version number:

gem 'mygem', '0.0.1', :path => '/path/to/gem'

Using >=0.0.1 for the version reverted to the original error. I can't explain any of this, however.

Quoting JD's helpful commment, from the Gemfile man page: "Similar to the semantics of the :git option, the :path option requires that the directory in question either contains a .gemspec for the gem, or that you specify an explicit version that bundler should use."

share|improve this answer
Not sure why this answer got voted down. Explicitly including the version number worked for me. –  George Anderson Apr 28 '11 at 20:09
Thanks--after revisiting this question I see that my answer was probably not addressing the specific, but rather the same error message. –  aceofspades Apr 29 '11 at 18:33
many thanks for providing a straightforward answer! –  Sumit Bisht Apr 26 '12 at 8:55
The same "must specify the version number" applies when copying the .gem into the vendor/cache folder –  brutuscat Aug 14 '12 at 6:13
To answer your question about the version number. From the Gemfile man page: "Similar to the semantics of the :git option, the :path option requires that the directory in question either contains a .gemspec for the gem, or that you specify an explicit version that bundler should use." –  JD. Jan 31 '13 at 15:50
add comment

Try unpacking the gem and then using the path in your Gemfile.


gem unpack my-gem-file.gem /my-rails-app/vendor/gems/

then add a line like so to your Gemfile

gem 'my-gem', '0.0.1', :path => 'vendor/gems/my-gem'

Obviously paths and version numbers will vary. You also might need to make the vendor/gems directory in your app root if it doesn't already exist.

share|improve this answer
More of a workaround than a solution... –  aceofspades Dec 24 '10 at 16:00
Agree this is a workaround, but until this functionality is built in it's the best answer for this situation –  bencode Jun 21 '11 at 19:18
add comment

Copy the gem in to vendor/cache directory in your application's root folder.

bundle install --local

This will install the local gem.

share|improve this answer
add comment

Since this gem will be local to any machine you'll be running your app on, just specify the gem in the Gemfile, then manually install the gem. When you run "bundle install", bundler will see it's already installed and move on.

This worked for me when installing a version of ruby-debug-base19 that wasn't available on rubygems.org yet.

Another way would be to set up your own gem server that's accessible to all your app servers. See http://guides.rubygems.org/run-your-own-gem-server/

I've never done this myself but it looks very simple. Just make sure you don't violate any of the Chilkat terms of service if your gem server is going to be on the Internet.

share|improve this answer
add comment

First unpack the gem using the solution by semanticart. Then add a gemspec in the unpacked gem. Bundler will be able to run properly.

Gem::Specification.new do |s|
  s.name         = "chilkat"
  s.version      = "9.4.1"
  s.platform     = Gem::Platform::RUBY
  s.required_rubygems_version = ">= 1.3.6"
  s.require_path = "lib"
  s.summary      = "Make do with a self written gemspec"
share|improve this answer
add comment

Your Answer


