The Power of Vendor/Gems

16 Sep 2007 in Programming, Projects, Ruby on Rails by Garrick

Right now, I’m heavily reliant on an unsupported (if not completely abandoned) ruby gem library. Historically, I’ve just gem install bizarro-gem and moved on.

A couple of issues have changed my perspective:

Thankfully, I found Chris Wanstrath’s Vendor Everything , his post makes it trivial to freeze gems in a reliable, testable, hackable way.

The core of Chris’s technique is added this line to your Rails::Initializer.run block:
config.load_paths += Dir["#{RAILS_ROOT}/vendor/gems/**"].map do |dir|
File.directory?(lib = “#{dir}/lib”) ? lib : dir
end

And unpack the required gems into vendor/gems

With that, I was able to make the necessary modifications and make a more portable app.

Thanks Chris.


Comment | Trackback URL Short Link:

Add a Comment


XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Related Entries




Creative Commons License
About Sitemap XHTML Sitemap XML
Wordpress theme is a heavily hacked version of "Modicus Remix" by Art Culture. Original by Upstart Blogger