gpt4 book ai didi

ruby-on-rails - 无法连接到数据库 - 无法将 PostgreSQL 数据库推送到 heroku

转载 作者:太空宇宙 更新时间:2023-11-03 18:22:30 24 4
gpt4 key购买 nike

我用几个条目创建了一个非常简单的博客应用程序,我想做的就是将它推送到 heroku,但我收到以下错误:

$ heroku db:push [git@github.com:appname/blog.git]
Loaded Taps v0.3.24
Auto-detected local database: postgres://benjaminw@127.0.0.1/blog_development?en
coding=WIN1252
Warning: Data in the app 'afternoon-taiga-2755' will be overwritten and will not
be recoverable.

! WARNING: Destructive Action
! This command will affect the app: afternoon-taiga-2755
! To proceed, type "afternoon-taiga-2755" or re-run this command with --conf
irm afternoon-taiga-2755

> afternoon-taiga-2755
Failed to connect to database:
Sequel::AdapterNotFound -> LoadError: cannot load such file -- pg

但是我已经安装了 pg gem 和 sequel gem。这是我的 gem 文件。我排除了几行,因为它们被注释掉了。有人遇到过这个问题吗?

source 'https://rubygems.org'

gem 'rails', '3.2.13'

# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'

gem 'pg'
gem 'activerecord-postgresql-adapter'
gem 'sequel'


# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'

# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', :platforms => :ruby

gem 'uglifier', '>= 1.0.3'
end

gem 'jquery-rails'

最佳答案

我在使用 db:pull 时遇到了同样的问题。在确保我安装了所有的 gem 之后,它开始工作了(提示:heroku db:pull not working)。

gem install pg heroku taps sequel

关于ruby-on-rails - 无法连接到数据库 - 无法将 PostgreSQL 数据库推送到 heroku,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15977025/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com