【发布时间】:2023-04-01 01:58:01
【问题描述】:
我无法在 heroku 上部署我的应用程序。我在 Gemfile 中添加了 'pg' gem,甚至尝试包含 gem 'therubyracer-heroku' 之类的东西。 期间
heroku rake db:migrate
我得到这样的东西:
>heroku rake db:migrate
--trace
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
rake aborted!
Please install the postgresql adapter: `gem install activerecord-postgresql-adap
ter` (pg is not part of the bundle. Add it to Gemfile.)
/app/.bundle/gems/ruby/1.9.1/gems/activerecord-3.1.1/lib/active_record/connectio
n_adapters/abstract/connection_specification.rb:71:in `rescue in establish_conne
ction'
另一个有趣的部分是,在捆绑安装操作期间没有提到推送到 heroku pg,就像它被忽略一样。我还观看了 Gemfile.lock 并在那里提到了 pg:
pg (0.11.0-x86-mingw32)
我想知道是否是 Windows gem 问题导致 heroku 忽略 pg gem 还是什么?
任何人都可以帮助或遇到类似的问题吗?
//编辑
似乎相关:enter link description here
而且看起来无法解决
【问题讨论】:
-
您最新的 Gemfile 和 Gemfile.lock 是否已在源代码管理中提交?
-
是的,我这样做是为了改变 gemfile 运行本地包,然后同时提交,然后推送给我错误
You have modified your Gemfile in development所以我在 .lock 文件中更改了某事,比如删除 PLATFORMS 部分以便能够推送 -
OK - 当您的 Gemfile.lock 与 Gemfile 中的内容不一致时,Heroku 通常会发出该消息。我会将您的存储库克隆到一个新位置,然后查看结果只是为了检查它是否在 git 中正确。否则,请联系 Heroku 支持。
标签: ruby-on-rails postgresql heroku