8

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)
Robert B
  • 2,863
  • 4
  • 31
  • 40
  • sqlite is a database and mongrel is a web server. So, why wouldn't you have database.yml file for that reason ?? And you are not using mongrel because you are using ruby 1.9.2 ? why is that ?? Getting confused with the question. – Prabesh Shrestha Jul 30 '11 at 15:03

3 Answers3

15

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
Matthew Burket
  • 316
  • 1
  • 5
  • If you're not using SQLite3 and you just copy this file, you'll get past this error and then into deep, dark hard to debug things (for me at lest). Don't just copy+past this if you're using another DB type, like MySQL. [Helpful info](http://stackoverflow.com/questions/5872264/correct-mysql-configuration-for-ruby-on-rails-database-yml-file) – dfarrell07 Mar 31 '14 at 07:13
5

You can use a different database configuration than the other developers of your project. Just add the database.yml to the .gitignore file. This is done automatically when generating a rails app and since the database.yml is missing on your machine that is already the case for your project too. So just create your personal database.yml file in the config folder of the app for your development environment.

Like this as minimal config:

development:
  adapter: sqlite3
  database: db/development.sqlite3

But Mongrel is not a database but a Web Server. Maybe the other developer is a using Mongo DB?

flex36
  • 146
  • 1
  • 3
0

Mongrel is a web server no?

You still need a database.yml file.