gpt4 book ai didi

ruby-on-rails - "no such file to load -- pg"尝试 rake db :create

转载 作者:数据小太阳 更新时间:2023-10-29 08:34:35 25 4
gpt4 key购买 nike

我的问题的症状很简单:

$ rake db:create
(in /home/jason/projects/blog)
rake aborted!
no such file to load -- pg

(See full trace by running task with --trace)

我已经成功运行了 bundle installgem install pg,所以我不知道我还需要做什么。

如果有帮助,这是我的`config/database.yml:

# SQLite version 3.x
# gem install sqlite3-ruby (not necessary on OS X Leopard)
development:
adapter: postgresql
encoding: unicode
database: blog_development
pool: 5
username: blog
password: foo

# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
adapter: postgresql
encoding: unicode
database: blog_development
pool: 5
username: blog
password: foo

production:
adapter: sqlite3
database: db/production.sqlite3
pool: 5
timeout: 5000

最佳答案

我想通了。如果我在我的 config/database.yml 中使用 pg 而不是 postgresql,它就可以工作。

关于ruby-on-rails - "no such file to load -- pg"尝试 rake db :create,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4564996/

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