How to use edge/nightlies with Bundler?

Skip to first unread message

John Labovitz

Aug 10, 2011, 7:00:21 PM8/10/11
I know this has come up a few times, but I'm still at a loss of how to handle this.

There is a recently-fixed bug in Nokogiri's master branch on GitHub. I have code in a Rails app that will benefit from this fix. I'm using Bundler, and have Nokogiri listed in the normal way (gem "nokogiri"). In order to get the latest version, I've tried to reference the GitHub master according to the docs at, like so (leaving out the :branch specifier):

gem "nokogiri", :git => "git://"

This doesn't work, as there's no .gemspec (yes, I understand this is intentional), so dependencies fail. So then I try this:

gem "nokogiri", '1.5', :git => "git://"

That works better, but because there's no .gemspec, it doesn't build the C extensions, and so Nokogiri never loads entirely.

I've seen a few references to some Nokogiri nighties, apparently hosted at, by adding a gem source to the Gemfile:

source ''
gem 'nokogiri', '>= 1.5.1'

But this is the result:

$ bundle update nokogiri
Fetching source index for
Fetching source index for
Could not reach rubygems repository,
Could not find gem 'nokogiri (>= 1.5.1)' in any of the gem sources listed in your Gemfile.

Thinking I could get to the nightly in the non-Bundler way, I see this:

$ gem sources -a
Error fetching
bad response Not Found 404 (

So... now what? Are there nighties at all? Should I avoid this all by simply making my own .gem and checking that into my project? Or should I wait for a 1.5.1 release, and if so, how long might that wait be?


Tim Elliott

Aug 10, 2011, 7:29:31 PM8/10/11
On Wed, Aug 10, 2011 at 4:00 PM, John Labovitz <> wrote:
>        gem "nokogiri", :git => "git://"
> This doesn't work, as there's no .gemspec (yes, I understand this is intentional), so dependencies fail.  So then I try this:

You can create your own fork and drop the generated gemspec in there.
I tried this in my github nokogiri fork and it seems to work:

$ cat Gemfile
gem "nokogiri", :git => "git://",
:branch => "with_gemspec"

$ bundle update
Updating git://
Using nokogiri (1.5.0) from git://
(at with_gemspec) with native extensions
Using bundler (1.0.17)
Your bundle is updated! Use `bundle show [gemname]` to see where a
bundled gem is installed.

I had to drop two CSS parser files into the repository as well.

Please fork my repository rather than referencing mine.

Hope this helps,

Reply all
Reply to author
0 new messages