This needs a pessimistic lock (at least). Please see: https://github.com/opscode-cookbooks/wordpress/blob/master/Gemfile