Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rails Local Server Error: No such file database.yml

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)
like image 935
Robert B Avatar asked Jul 26 '11 00:07

Robert B


2 Answers

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
like image 78
Matthew Burket Avatar answered Sep 26 '22 03:09

Matthew Burket


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?

like image 44
flex36 Avatar answered Sep 25 '22 03:09

flex36