How to Bundler 0.9.5, Rails 2.3.5, and running on Heroku
So Heroku recently updated to the latest Bundler this week. I did the update locally, did all the Gemfile changes, and pushed to heroku… moments later my app died! Now I should have pushed it to a new heroku app instance so I didn't bring down a production app, so lesson learned.
I put together my notes on what I needed to get everything back up and running smoothly as well as getting my local setup working:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# put this directly above the Rails.boot! line
class Rails::Boot
def run
load_initializer
extend_environment
Rails::Initializer.run(:set_load_path)
end
def extend_environment
Rails::Initializer.class_eval do
old_load = instance_method(:load_environment)
define_method(:load_environment) do
Bundler.require :default, RAILS_ENV
old_load.bind(self).call
end
end
end
end
|
I'm running Snow Leopard, Bundler 0.9.5, Rails 2.3.5, and use SQLite for my production DB.
Advertisement