开发者

Issues upgrading bundler to 0.9.4 with Rails 2.3.5

Heroku made all its apps upgrade to the latest version of bundler (0.9.4).

I followed all the instructions found on the README (including the upgrading instructions). But once I upgrade my application no longer runs. For example i get

NoMethodError (undefined method `acts_as_taggable_on' for #<Class:0x1b7f614>):

My Gemfile is as follows

source 'http://gemcutter.org'
source 'http://gems.github.com'

gem "rails", "2.3.5", :require => nil

gem 'will_paginate', '2.3.11'
gem 'jackdempsey-acts_as_commentable', :require => 'acts_as_commentable'
gem 'acts-as-taggable-on'

# Authorization
gem 'authlogic'
gem 'authlogic-oid', :require => 'authlogic_ope开发者_高级运维nid'
gem 'ruby-openid', :require => 'openid'

#Authentication
gem 'cancan'

gem 'gravtastic', '>= 2.1.0'

# Exception Notification
gem 'hoptoad_notifier'

# Search (Note ties us to Postgres)
gem 'texticle'

gem 'pg'

My boot.rb,preinitializer.rb are as instructed in this gist

Thanks for your help.


Please don't ask me how this works, but I had the same exact issue with what seemed to be failing actionpack dependencies or paths or something.

I used all of the gist referred to by the bundler team: http://gist.github.com/302406

But I tweaked my config/boot.rb script to this:

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_gems)
      define_method(:load_gems) do
        old_load.bind(self).call
        Bundler.require :default, RAILS_ENV        
      end
    end
  end
end

I dont know why my config variables were different, but for some reason they are. I'm sure someone who understands the internals a bit better than I do can explain it.

*For heroku you'll also have to have the postgres "pg" gem installed. This was another minor annoyance. Depending on how you install postgres, finding pg_config can be another headache. Let me know if you need help with this.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜