Rails和postgres – 在heroku上部署时忽略了pg gem

我在heroku上部署我的应用程序时遇到问题。 我已经将’pg’gem添加到Gemfile中,甚至尝试包含类似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) 

我想知道它是否是导致heroku忽略pg gem或其他东西的Windows gem问题?

任何人都可以帮助或有类似的问题?

//编辑

似乎相关: 在此处输入链接描述

而且看起来不可解决

在您的Gemfile限制postgres到您的生产组;

 group :production do gem "pg" end 

重新打包

 bundle --without production 

并提交git(Gemfile和Gemfile.lock)并推送到Heroku。 这应该可以解决你的问题。