Rails: Failed to load database configuration. There is no such file -

I cloned the application folder from the GitHub repository, and after the package installed the gems, I tried using rake db: setup and rake db: migrate commands, it didn’t work, 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 this, I will be forever grateful.

+7
ruby ruby-on-rails activerecord ruby-on-rails-3 gem
source share
4 answers

Did your rails application have a missing file:

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

if you can create new these examples

+12
source share

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

+1
source share

I also encounter this problem. The open my: config file found in the file has a file named "database.yml.example", but does not have the files "Database.yml". Therefore, I am copying this file from another project, and this problem has been resolved.

+1
source share

Remove the .example extension from .yml files

  database.yml.example -> database.yml 
0
source share

All Articles