加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

ruby-on-rails – 在Heroku上部署Ruby on Rails应用程序时出现“

发布时间:2020-12-17 04:36:40 所属栏目:百科 来源:网络整理
导读:我试图在Heroku上使用带 Ruby on Rails的postgresql但是出错了 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::Loa
我试图在Heroku上使用带 Ruby on Rails的postgresql但是出错了
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中
group :production do
  gem 'pg'
end

然后运行bundle install并尝试在Heroku上部署.

如果您想在所有环境中使用PostgreSQL,而不仅仅是在生产环境中(推荐),请在:production group之外添加gem,并删除其他数据库适配器,例如sqlite.

作为旁注,您可能还想按照Heroku的建议添加rails_12factor gem.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读