简体   繁体   English

在Rails 2.3.5中将捆绑程序升级到0.9.4的问题

[英]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). Heroku已将其所有应用程序升级到最新版本的捆绑程序(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 我的Gemfile如下

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_openid'
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 我的boot.rb,preinitializer.rb遵循本要点中的指示

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 我使用了捆绑程序团队提到的所有要点: http : //gist.github.com/302406

But I tweaked my config/boot.rb script to this: 但是我将config / boot.rb脚本调整为:

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. *对于heroku,您还必须安装postgres“ pg” gem。 This was another minor annoyance. 这是另一个小烦恼。 Depending on how you install postgres, finding pg_config can be another headache. 根据安装postgres的方式,找到pg_config可能是另一个麻烦。 Let me know if you need help with this. 让我知道您是否需要帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM