Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 614 Vote(s) - 3.5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
rails : Could not load database configuration. No such file -

#1
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.
Reply

#2
For the ones that came here, right after cloning a **Rails 5.2 (or newer)** project, you might be missing the `master.key` file. Ask the project owner for the file.

At the folder `your-rails-project/config/` you will have a `credentials.yml.enc` file. It is an encrypted file with the credentials of the project, which is decrypted with the key in the `master.key` file.

Rails needs to access the credentials file to be able to execute, even when only preparing the database (`rails db:prepare`, as in the `bin/setup` file).

For more info:

[To see links please register here]

.
Reply

#3
Restart spring:

bin/spring stop

bin/spring start

Spring is an in memory pre-loader for before performance. If you do something crazy like change your Rails application directory and then re git clone, the underlying directory that Spring owns will be internally different and that will cause this to fail. And you will think that you are going insane; you're not -- Spring can be a mild pissant at times.
Reply

#4
I meet this problem, too.
Opened my file: config, found in the file, have a file named "database.yml.example",
but haven't file
"database.yml".
So I copy this file from the other project, and this problem solved.
Reply

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

#6
Remove .example extension from .yml files

database.yml.example -> database.yml
Reply

#7
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][1]


[1]:
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through