arturcp / postgresql-backup

Automate PostgreSQL's backup and restore
11 stars 9 forks source link

NoMethodError: undefined method `connection_db_config' #5

Open Enzo161 opened 1 year ago

Enzo161 commented 1 year ago

Afer running the command 'bundle exec rake postgresql_backup:dump' it throws me the following error:

image

I'm quite new to rails and still am exploring, I'd appreciate it greatly if anyone can help me with this error.

Note: I'm currently using ruby 2.6.10 with rails 6.0.6 so I installed the 0.0.6 version of the gem

arturcp commented 1 year ago

Hello, @Enzo161! Thanks for sharing this, I will take a look to see what is going on

arturcp commented 1 year ago

@Enzo161 I run some tests on a brand new project with the version you used for Ruby and for Rails. I managed to reproduce the problem when I added the gem to my Gemfile like this:

gem 'postgresql-backup', '~> 0.0.6'

I was trying to use version 0.0.6, but this line of code actually installs the 0.0.7, which produces the error you are receiving. Can you check your Gemfile to see if that is the cause of the error for you?

If that's the case, use this in your Gemfile instead:

gem 'postgresql-backup', '0.0.6'

And run bundle install again. Let me know if that helps you.

Enzo161 commented 1 year ago

Sorry for the late feedback, just tested it today and it worked fine. Thank you for this! The only problem I have now is that when I run the dump command, no SQL file is actually being saved (currently using the local machine to test dump/restore), I'm clueless as to what is causing this behavior.

arturcp commented 1 year ago

Hi, @Enzo161, let me see if I can figure this out as well

arturcp commented 1 year ago

@Enzo161 in my first run here was no file generated under db/backups either, but at the end it was because there was no data in my database. As soon as I added the first record, the backup was generated. Can you confirm if this is your case?