Gem使用错误的activesupport版本(3.0.3),部署到Heroku时应使用2.3.9

时间:2010-11-30 01:55:44

标签: ruby-on-rails heroku gem activesupport

我有一个使用gem的rails 2.3.9应用程序,当我在本地运行它时工作得很好。但是,当我尝试将我的应用程序推送到heroku时,它断言说gem激活了activesupport 3.0.3,并且我的heroku应用程序无法运行activesupport 2.3.9因为3.0.3已经被激活...我已经卸载了activesupport 3.0.3本地,并在本地重新安装gem但仍然无法在heroku中工作。

  1. 是否真的卸载了activesupport3.0.3(sudo gem uninstall activesupport -v 3.0.3)?
  2. 为什么gem在我的本地环境中工作而不是heroku?
  3. 当推送到heroku(git push heroku master)并且它读取.gem文件时,为什么当它开始安装gem时,它仍然继续在heroku上安装activesupport 3.0.3 ??
  4. my heroku logs:

    ==> dyno-3352306.log(崩溃)< == /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems.rb:233:in'activate':无法为[“rails-2.3.9”]激活activesupport(= 2.3.9,运行时),已经为[“THISGEM-1.2.3”]激活了activesupport-3.0.3(Gem :: LoadError)

    有人可以给我一些指导吗?非常感谢您的帮助!

    .gems

    rails --version 2.3.9
    will_pagnate --version x.x.x
    THISGEMTHATDEPENDSONACTIVESUPPORT&HPRICOT--version 1.2.3 --ignore-dependencies
    hpricot --version x.x.x
    

1 个答案:

答案 0 :(得分:0)

在尝试了gemfile bundler方法之后,让will_pagnate在本地和部署上都打破了我,我再看一遍.gems了。这次它有效!!我不知道我改变了什么,但我认为你列出宝石的顺序很重要......“THISGEMTHATDEPENDSONACTIVESUPPORT& HPRICOT”需要在hpricot之后发布。这样当heroku读取gems文件时,它会在安装“THISGEMTHATDEPENDSONACTIVESUPPORT& HPRICOT”之前安装依赖项。我的最终.gems文件看起来像这样,它工作了!有人可以确认是这种情况吗?太棒了,我被困在这两天,只是为了找出你列出宝石的顺序。

rails --version 2.3.9
will_pagnate --version x.x.x
hpricot --version x.x.x
THISGEMTHATDEPENDSONACTIVESUPPORT&HPRICOT--version 1.2.3 --ignore-dependencies