Matt Gornick's Blog

a day in the life of an entrepreneur

How to Bundler 0.9.5, Rails 2.3.5, and running on Heroku

leave a comment »

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

Written by mattgornick

February 18, 2010 at 6:09 pm

Posted in Personal

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.