gpt4 book ai didi

ruby-on-rails - Rails本地服务器错误: No such file database. yml

转载 作者:行者123 更新时间:2023-12-04 04:23:28 31 4
gpt4 key购买 nike

我正在与另一个开发人员进行项目,尝试启动本地服务器时出现错误。缺少database.yml。我正在使用sqlite,另一个开发人员在使用mongrel,因此我没有database.yml文件。我不使用Mongrel,因为我使用的是 ruby 1.9.2,而他使用的是 ruby 1.8.7。

有没有办法解决此错误?

LIONIDAS:project robertb$ rails s
=> Booting WEBrick
=> Rails 3.0.3 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
Exiting
/Users/robertb/.rvm/gems/ruby-1.9.2-p0@rails/gems/railties-3.0.3/lib/rails/application/configuration.rb:88:in `read': No such file or directory - /Users/robertb/Sites/project/config/database.yml (Errno::ENOENT)

最佳答案

因此仍然需要添加database.yml。您需要一个定义您的SQLite数据库。
像这样:

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

关于ruby-on-rails - Rails本地服务器错误: No such file database. yml,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6824036/

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