'Rails couldn't infer whether you are using multiple databases from your database.yml in rails - 6 using nginx

While deploying code using capistrano gem -

  • Rails couldn't infer whether you are using multiple databases from your database.yml and can't generate the tasks for the non-primary databases. If you'd like to use this feature, please simplify your ERB.\r rake aborted!\r

ruby 2.7 Using rails 6



Solution 1:[1]

I just ran into this same issue. The problem apparently comes from Psych 4.0.0 which makes Psych.load refuse to load untrusted data. (See the pull request Use Psych.safe_load by default #487)

Rails addresses this , but not until 7.0.2.4

You can restrict psych in your Gemfile:

gem 'psych', '< 4.0.0'

and then a normal bundle update psych probably resolves the issue (or you might have to update other gems as I did due to versions which required psych >= 4.0.0)

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Rob Biedenharn