【问题标题】:Installing pg gem for deploying rails app via heroku (windows)通过heroku(windows)安装pg gem以部署rails应用程序
【发布时间】:2015-05-06 22:38:03
【问题描述】:

运行 'heroku run rails console' 我得到以下错误:

Running `rails console` attached to terminal... up, run.7453
    /app/vendor/bundle/ruby/2.1.0/gems/activerecord4.2.1/lib/active_record/connection_adapters/connection_specification.rb:177:in
 `rescue in spec': Specified 'postgresql' for database adapter, but the gem is
 not loaded. Add `gem 'pg'` to your Gemfile (and ensure its version is at the
 minimum required by ActiveRecord). (Gem::LoadError)

这是在我的 Gemfile 中:

gem 'pg', '~> 0.18.1'

【问题讨论】:

  • 在将那行添加到 Gemfile 之后,您是否运行了 bundle install
  • 你跑bundle install了吗?
  • 是的,自从添加 gem 后我已经运行了 bundle install
  • 在 config/database.yml 中是否指定使用 postgres?

标签: ruby-on-rails ruby windows ruby-on-rails-3 heroku


【解决方案1】:

你需要在配置文件中指定使用 pg gem 以及运行 bundle install

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-11-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-01-07
    • 2021-08-27
    • 2014-04-07
    • 1970-01-01
    相关资源
    最近更新 更多