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:
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!
run the command bundle install in your shell, once you have your Gemfile created. This command will look your Gemfile and install the relevant Gems on the indicated versions. The Gemfiles are installed because in your Gemfile you are pointing out the source where the gems can be downloaded from.
In the invoked popup, start typing bundler, select bundle install and press Enter . Select Tools | Bundler | Install from the main menu. Open the Gemfile, place the caret at any highlighted gem missing in the project SDK and press Alt+Enter . Select Install missing gems using 'bundler' and press Enter .
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."
Try unpacking the gem and then using the path in your Gemfile.
i.e.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With