Marco Marco - 1 year ago 60
Git Question

Why can't Bundler locate this gem?

Why can't bundler locate the Mechanize gem?

The following is in my Rails project's Gemfile:

gem 'mechanize', :git => 'git://'

Running bundle install throws the following error:

Updating git://
Fetching source index for
Could not find gem 'mechanize (>= 0)' in git:// (at master).
Source does not contain any versions of 'mechanize (>= 0)'

I arrived at this problem after forking the project to make some small changes, but was not able to get bundler to use the github location nor a local path. Why is it that it cannot locate the gem?

If I remove all instructions and simply do
gem 'mechanize'
then it works flawlessly.

Versions: Bundler 1.0.14 + Rails 3.1 Release Canditate + Ruby 1.8.7 (via RVM) + Debian 5

Answer Source

It looks as though the project is missing a gemspec and one won't be getting added.

You should be able to clone the project into your vendor/gems directory. You will need to create a mechanize.gemspec file, too. You would then require it in your Gemfile using something like.

gem 'mechanize',            :path => 'vendor/gems/mechanize'
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download