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。 这应该可以解决你的问题。
- Rails Passenger Glyphicon CORS Cloudfront NGINX问题
- Rails 3.1 Asset Pipeline – 关闭Heroku上的图像资产指纹识别?
- 动作电缆在本地订阅,但不在heroku上订阅
- ActionView :: Template :: Error(在heroku上没有将Fixnum隐式转换为String
- Heroku Cedar – 没有安装Resque前端的静态资产
- 获取错误:在部署/迁移到Heroku时更新rubygems
- 如何从我的Rack应用程序中删除“Server”HTTP响应标头
- 如何使用git复制rails app并部署到heroku
- Rails 4 session.id偶尔为零