Gem 使用错误的 activesupport 版本 (3.0.3),部署到 Heroku 时应使用 2.3.9
我有一个 Rails 2.3.9 应用程序,它使用 gem,当我在本地运行它时,它工作得非常好。但是当我尝试将我的应用程序推送到heroku时,它会中断说gem激活了activesupport 3.0.3,并且我的heroku应用程序无法运行activesupport 2.3.9,因为3.0.3已经激活了...我已经卸载了activesupport本地3.0.3,并在本地重新安装了gem,但在heroku中仍然不起作用。
- activesupport3.0.3真的被卸载了吗(sudo gem uninstall activesupport -v 3.0.3)?
- 为什么 gem 在我的本地环境中工作,而不是在 heroku 中工作?
- 当推送到heroku(git push heroku master)并读取.gem文件时,为什么当它开始安装gem时,它仍然继续在heroku上安装activesupport 3.0.3?
我的 Heroku 日志:
==> dyno-3352306.log(崩溃)<== /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems.rb:233:在`activate'中:无法激活[“rails-2.3.9”]的activesupport(= 2.3.9,运行时),已经为 ["THISGEM-1.2.3"] (Gem::LoadError) 激活了 activesupport-3.0.3
有人可以给我一些指导吗?非常感谢您的帮助!
.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
I have a rails 2.3.9 app that uses a gem and works perfectly fine when I run it locally. But when I try to push my app to heroku it breaks saying that the gem activated activesupport 3.0.3, and that my heroku app can't run activesupport 2.3.9 because 3.0.3 is already activated... I've uninstalled activesupport 3.0.3 locally, and re-installed the gem locally but still doesn't work in heroku.
- Was activesupport3.0.3 really uninstalled (sudo gem uninstall activesupport -v 3.0.3)?
- Why does the gem work in my local environment and not heroku?
- When pushing to heroku (git push heroku master) and it reads the .gem file, why is it that when it starts installing the gem, it still continues to install activesupport 3.0.3 on heroku??
my heroku logs:
==> dyno-3352306.log (crash) <==
/usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems.rb:233:in `activate': can't activate activesupport (= 2.3.9, runtime) for ["rails-2.3.9"], already activated activesupport-3.0.3 for ["THISGEM-1.2.3"] (Gem::LoadError)
can someone give me some guidance?? Your help is mucho appreciated!
.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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在尝试了 gemfile 捆绑器方法,并让 will_pagnate 在本地和部署时都中断之后,我再次查看了 .gems 清单。这次成功了!我不知道我改变了什么,但我认为你列出宝石的顺序很重要..“THISGEMTHATDEPENDSONACTIVESUPPORT&HPRICOT”需要在 hpricot 之后。这样,当heroku读取gems文件时,它会在安装“THISGEMTHATDEPENDSONACTIVESUPPORT&HPRICOT”之前安装依赖项。我的最终 .gems 文件如下所示,并且成功了!有人可以证实情况确实如此吗?太棒了,我在这个问题上坚持了两天,才发现这是你列出宝石的顺序。
after trying the gemfile bundler method, and having will_pagnate break on me both locally and on deployment, I had a look at .gems manifest one more time. and this time it worked!! I don't know what I changed but I think the order in which you list your gems matter.. the "THISGEMTHATDEPENDSONACTIVESUPPORT&HPRICOT" needs to go AFTER hpricot. so that when heroku reads the gems file, it installs the dependencies BEFORE installing the "THISGEMTHATDEPENDSONACTIVESUPPORT&HPRICOT". my final .gems file looked like this, and it worked! can someone confirm that this is the case? Amazing, I was stuck on this for 2 days, only to find out its the order you list your gems.