Distributing Rails 3 apps

Jason Guiditta jason.guiditta at gmail.com
Wed Aug 10 19:26:16 UTC 2011


On Wed, Aug 10, 2011 at 9:29 AM, Lukas Zapletal <lzap+fed at redhat.com> wrote:
> On 08/10/2011 03:25 PM, Jason Guiditta wrote:
>>> if use_bundler
>>> >     Bundler.require(:default, Rails.env)
>>> >  else
>>> >     require 'foo'
>>> >     require 'bar'
>>> >     require 'baz'
>>> >     ...
>>> >  end
>>> >
>>> >  But maybe that is too simplistic.
>>> >
>> That seems like a reasonable first pass to me too, I'll give it a try
>> today on conductor and see how it goes.  If it works, it would be nice
>> to have those requires in one place (some kind of template that gets
>> pulled in directly or transformed into a Gemfile perhaps).
>
> Yeah I tried this approach two days ago - and one of our initializers
> were screaming about unknown "_" method. I guess this had something to
> do with gettext, but I already had all our gettext modules required.
>
> I gave up for now.
>
> --
> Later,
>   Lukas "lzap" Zapletal
> _______________________________________________
>

FYI, I tried this today, and it seems to work.  I set an env variable
to toggle use of bundler, and added requires that only get called if
you are not using bundler.  One difference to note is that some
libraries have different names than their gems.  For instance, in you
Gemfile, you might have:

gem 'compass-960-plugin', :require => 'ninesixty'

but in your require, you would need:

require 'ninesixty'

There could be other speed bumps, but so far so good on this.


More information about the ruby-sig mailing list