Rails 本地服务器错误:没有那个文件 database.yml [英] Rails Local Server Error: No such file database.yml

查看:37
本文介绍了Rails 本地服务器错误:没有那个文件 database.yml的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I'm working on a project with another developer and I'm getting an error when trying to start my local server. Missing database.yml. I'm just using sqlite and another developer is using mongrel therefore I don't have a database.yml file. I'm not using Mongrel because I'm on ruby 1.9.2 and he is on ruby 1.8.7.

有没有办法解决这个错误?

Is there a way to fix this error?

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 数据库.像这样:

So still need add database.yml. You need one defining your SQLite Database. Like so:

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

这篇关于Rails 本地服务器错误:没有那个文件 database.yml的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆