Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

rails : Could not load database configuration. No such file -

I cloned an app folder from a GitHub repository, and after bundle install the gems, I tried to use the rake db:setup and rake db:migrate commands, neither worked, and here is my error message:

**arun997@promanager:~/workspace (master) $ rake db:setup
require 'rails/all'... 2.470s
Bundler.require... 7.590s
rake aborted!
Cannot load `Rails.application.database_configuration`:
Could not load database configuration. No such file - 
/usr/local/rvm/gems/ruby-2.2.1/gems/railties-4.1.13/lib/rails/application/configuration.rb:105:in `database_configuration'
/usr/local/rvm/gems/ruby-2.2.1/gems/activerecord-4.1.13/lib/active_record/railtie.rb:41:in `block (3 levels) in <class:Railtie>'
Could not load database configuration. No such file - 
/usr/local/rvm/gems/ruby-2.2.1/gems/railties-4.1.13/lib/rails/application/configuration.rb:105:in `database_configuration'
/usr/local/rvm/gems/ruby-2.2.1/gems/activerecord-4.1.13/lib/active_record/railtie.rb:41:in `block (3 levels) in <class:Railtie>'
Tasks: TOP => db:setup => db:schema:load_if_ruby => db:create => db:load_config
(See full trace by running task with --trace)**

If anyone can help with i would be eternally grateful.

like image 943
Arun Anand Avatar asked Sep 12 '15 12:09

Arun Anand


3 Answers

Would your rails app be missing the file:

/your-app-path/config/database.yml

if so you can create a fresh one with these examples

like image 125
The Fabio Avatar answered Oct 14 '22 20:10

The Fabio


Remove .example extension from .yml files

     database.yml.example -> database.yml
like image 5
panwar001 Avatar answered Oct 14 '22 18:10

panwar001


step: cp config/database.yml.example config/database.yml bundle check bundle install rails s again

like image 2
BnakJM Avatar answered Oct 14 '22 20:10

BnakJM