arturcp / postgresql-backup

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

Configuration block unitialized constant error #3

Closed evio-fragoso closed 2 years ago

evio-fragoso commented 2 years ago

After installing the gem and adding the initializer for configuration the following error is raised:

constant error

I tried to change versions without success. I'm using ruby 2.7.6 and rails 6.1.4

arturcp commented 2 years ago

Thanks for reporting this, @evio-fragoso, I will take a closer look to understand what is going on

arturcp commented 2 years ago

@evio-fragoso can you try to require postgresql_backup in the first line of your initializer?

require 'postgresql_backup'

PostgresqlBackup.configure do |config|
  # This gem works with two possible repositories:
  ...

Also, add this to your Rakefile, but before Rails.application.load_tasks:

require 'postgresql_backup'

I created a new rails project with the versions you use and these two lines solved the issue for me:

Let me know if the issue is gone with that, so I can update the README

evio-fragoso commented 2 years ago

@arturcp it worked after requiring in these files. Thank you!