Bundler and Public Git Sources
Thu Sep 16 17:58:00 -0700 2010
If you have a public git source in your production Gemfile, then you are doing it wrong.
Bundler rocks. It lets us point our Gemfile source at almost anything, a path, a git source and of course RubyGems.org.
But if you are using production code, and you have something like this in it:
gem "mail", :git => 'git://github.com/mikel/mail.git'
Then you are most likely doing it wrong.
Why? Well, you have no guarantee that I will keep that repository around. I (or any github user) could just deleted it tomorrow. And then your deploy is broken.
Not only that, the reason you are pointing to a git source is because there is some production critical feature that you need from the git source. Otherwise, you would just be specifying the gem version in your Gemfile.
So this is a recipe for disaster.
I recently took over a project (Rails 2.2.2) that had over 13 gems specified in the environment.rb file using the Rails 2.x style config.gem commands that were pointing to explicit gems inside of Github. My first action was to go in and Fork those gems into the client’s public git repository and depend on THOSE versions, ones that are under our control.
Of course, the next step is to go through and remove any git dependency from the Gemfile, one by one and just revert to normal gems from somewhere like RubyGems. But this has to be done incrementally and will happen over the coming weeks.
So, go through your production code, and if you are pointing at someone else’s github tree, just go in and fork it and point at your own. It is cheap insurance.
blogLater
Mikel
Leave a Reply
Latest posts
- Encrypting Another Partition Using FileVault 2 on OSX Lion
- Installing Home Folder on Second Drive on OSX Lion
- undefined local variable or method `version_requirements'
- A New World of Resources
- Rails Static Pages
- Twitter Replacing Rails? So?
- Engine Yard Cloud Backups Generating Zero Length Backups
- Our Rails Rumble Entry - StillAlive.com
- Renaming a controller and redirection in Rails 3
- Updating RailsPlugins.org to Rails 3 - Part 1
- A new protocol for social interaction
- What is a distributed social network?
- Getting Heroku, memcached and Rails 3 working
- Why Bundler?
- Rails Commit Access
- Introducing TellThemWhen
- rake RSpec & Cucumber uninitialized constant Rails::Boot::Bundler
- This Relationship is Worth Nothing
- Thank YOU...
- Inline Attachments for ActionMailer
- Upgrading RailsPlugins.org to Rails 3 - Part 1
- Stripping dollar signs and commas from a string
- Getting Rails 3 Edge with jQuery, RSpec and Cucumber using RVM
- Action Mailer, go Proc thyself
- The Real News Donation Drive
- ActionMailer ScreenCast and Article
- Installing RSpec for Rails 3
- I am speaking at RailsConf 2010
- Rails 3 Session Secret and Session Store
- If you're lazy and you know it write your specs!
- Bundler - uninitialized constant ActionController
- Bundle Me Some Sanity
- How to use Mail / ActionMailer 3 with GMail SMTP
- Put your mailer where the action is!
- Why Force a Choice?
- How to make an RSS feed in Rails
- Rails 3 Routing with Rack
- Bundle me some Rails
- Helping out in Haiti
- Watch your self
- Is Rails 3.0 a Game Changer?
- Where did the scripts go?
- validates :rails_3, :awesome => true
- New Rails Version 3.0 Guides Online
- New ActionMailer API in Rails 3.0
- Mail gem version 2 released
- How to rename a Rails 3 Application
- Rails 3.0 Examples
- DECCA Driving Day
Latest comments
- http://bit.ly/zqUBit
I forgot to say that, I don't r...
- ökostrom preise
Thanks a lot for this wonderful...
- Gainesville Computer Repai
I love its culture,the sakura t...
- Collector Credit AB
Great site and a great topic as...
- Hur Mycket Skatt
The blog was absolutely fantast...
Categories
Tag Cloud
AJAX ARGH! ActiveRecord Ajax Apache Apple Asterisk Australia Copy Database Development Feedburner Gem server Google Human Rights Javascript L. Ron Hubbard MS SQL Server MacOSX Mail Mephisto Not Programming OpenBSD Opensource Performance Personal Integrity PostgreSQL Programming Prototype Puzzle RDoc REST RESTful Rails RSPec RSpec Rails Rails Tips Rspec Ruby Ruby on Rails Ruby on Rails Tips Ruby on rails Tips SQL SQLServer SVN Scientologist Scientology Site Stats Soekris Soekris net5501 TMail Textmate Tips Windows World about mikel anti drug apache contributing daemon documentation drugs illustrator javascript lambda mail mephisto newspapers nitro open source opensource photoshop productivity programming railscasts rspec ruby ruby on rails rubyforge scientology seo sitemap sqlserver tips tmail tom cruise unix tricks vector graphicsArchives
- November 2009 (1)
- October 2009 (2)
- September 2009 (2)
- August 2009 (0)
- July 2009 (1)
- June 2009 (0)
- May 2009 (1)
- April 2009 (0)
- March 2009 (0)
- February 2009 (0)
- January 2009 (2)
- December 2008 (0)
- November 2008 (5)
- October 2008 (0)
- September 2008 (1)
- August 2008 (0)
- July 2008 (2)
- June 2008 (13)
- May 2008 (7)
- April 2008 (18)
- March 2008 (8)
- February 2008 (5)
- January 2008 (7)
- December 2007 (20)
- November 2007 (22)




Tue Nov 08 19:35:59 -0800 2011
Very interesting point. Interesting enough I’m using similar approach with several of js libs I use with git submodules.
Fri Sep 17 04:03:58 -0700 2010
Very interesting point. Interesting enough I’m using similar approach with several of js libs I use with git submodules.
Fri Sep 17 10:34:44 -0700 2010
Your totally right. From worst to best I would say:
gem “mail”, :git => ‘git://github.com/mikel/mail.git’
gem “mail”, :git => ‘git://github.com/mikel/mail.git’, :ref => ‘5efd6s…’
gem “mail”
gem "mail, “2.3.4”
Specify the version – it could save you from being forced to fix your code every time a new version of a gem is released.
I work on a Rails 3 app and we don’t have any other choice than using git repos as the gems for Rails 3 are not released yet. For instance:
gem ‘will_paginate’, :git => “git://github.com/mislav/will_paginate.git”, :branch => ‘rails3’
In that case… you could fork mislav’s repo in case he deletes it. :)
Sun Feb 05 20:23:21 -0800 2012
Very interesting point. Interesting enough I’m using similar approach with several of js libs I use with git submodules.why am i so tired gd hypothyroidism symptoms