bundler questions

17 views
Skip to first unread message

Seb Bacon

unread,
Mar 12, 2012, 10:06:10 AM3/12/12
to alavet...@googlegroups.com
Hi,

I just merged @jpmckinney's bundler branch to develop, so Alaveteli
now installs dependencies with bundler. This should have three
benefits:

1) More portable (particularly wrt OS X)
2) Easier to install more recent dependency versions when necessary
3) It's the Expected Way To Do it in Rails 3, and at some point we
should be considering migrating in that direction

For those of you familiar more familiar with Bundler than me, I have a question:

The latest release of xapian-full doesn't work on Ubuntu. The bug is
fixed in the unreleased version on github. I can force bundler to use
a version from github, thus:

gem 'xapian-full', :git => 'https://github.com/rlane/xapian-full'

However, I find that with this configuration, each "bundle install"
causes it to be recompiled. The behaviour I want is for it only to be
recompiled if the source has changed. Any pointers?

Thanks,

Seb

--
skype: seb.bacon
mobile: 07790 939224
land: 01531 671074

Gabriela

unread,
Mar 12, 2012, 10:41:22 AM3/12/12
to alavet...@googlegroups.com
You could specify the commit that you want the gem from with "ref"

 gem 'xapian-full', :git => 'https://github.com/rlane/xapian-full',
:ref => "7d577f7fa2"


Info here http://gembundler.com/git.html

James McKinney

unread,
Mar 12, 2012, 10:43:26 AM3/12/12
to alavet...@googlegroups.com
I thought if the Gemfile.lock was up-to-date, that it would not recompile the gem. Hmm.

Btw, in case you didn't catch this, the bundle command to run in production would be:

bundle install --without development:test --deployment

Gabriela

unread,
Mar 12, 2012, 1:39:34 PM3/12/12
to alavet...@googlegroups.com
Other option is to do a fork and use that for the gem. So we are sure
that we add to the gem only the changes we want...

Seb Bacon

unread,
Mar 13, 2012, 7:02:15 AM3/13/12
to alavet...@googlegroups.com
Hi Gabriela,

Thanks, but specifying a full ref still results in bundler recompiling
the extension each time I run "bundle install". I can't find any
mention of this behaviour in the docs. As James says, I would have
expected the Gemfile.lock to govern this behaviour.

Looking at the bundler source code, I see that for a Rubygems source,
there is code to skip the installation step if it's already installed
[1]. However, for a Github source, there is no corresponding logic
[2].

I don't really have time to investigate this further, which is
frustrating. I'm half-guessing from scanning the Bundler code that it
is meant to fake up gem specs for things that aren't actually provided
as packaged gems, and somehow this hasn't been implemented for github
sources. Which means that Gem doesn't know about things installed via
github. Something like that *waves hand*.

Unfortunately, this will hold up making a release because we promise
to support Ubuntu. I guess if no-one else has time to investigate I
could petition the xapian-full maintainer to make a new release to
rubygems. Maybe I'll do that anyway as fixing this would appear to
need a fix to Bundler...

Thanks,

Seb

[1] https://github.com/carlhuda/bundler/blob/master/lib/bundler/source.rb#L73
[2] https://github.com/carlhuda/bundler/blob/master/lib/bundler/source.rb#L560

James McKinney

unread,
Mar 13, 2012, 11:20:24 AM3/13/12
to alavet...@googlegroups.com
What version of Bundler is it?

Seb Bacon

unread,
Mar 13, 2012, 11:27:44 AM3/13/12
to alavet...@googlegroups.com
not at my computer now -- but whatever you got about a week ago when
you "gem install bundler"...

seb

Seb Bacon

unread,
May 31, 2012, 4:58:50 AM5/31/12
to alavet...@googlegroups.com
Just for the record (and because I'm referencing this email in a
comment in the source code...), I forgot to link to a specific version
of the above. The two links, frozen at the correct point in time,
should be:

[1] https://github.com/carlhuda/bundler/blob/1f2cd74eefbe4c5b5677b78e50375d3d2a46eb15/lib/bundler/source.rb#L73
[2] https://github.com/carlhuda/bundler/blob/1f2cd74eefbe4c5b5677b78e50375d3d2a46eb15/lib/bundler/source.rb#L560
Reply all
Reply to author
Forward
0 new messages