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)
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
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?
Mongrel is a web server no?
You still need a database.yml file.
精彩评论