`initialize': the scheme postgres does not accept registry part: postgres:@ (or bad hostname?) (URI::InvalidURIError) with Docker

后端 未结 3 987
Happy的楠姐
Happy的楠姐 2021-02-13 12:38

I\'m using Rails with Postgres DB Docker container attached. It looks like I\'m getting below error when I run rails c:

/usr/local/rvm/rubies/ruby-2         


        
3条回答
  •  暖寄归人
    2021-02-13 13:16

    Rename your environment variable!

    DATABASE_URL is reserved by Rails, and interpreted by ActiveRecord itself. I ran into the same issue.

    Instead, use something like this:

        host:     <%= ENV['DB_HOST'] %>
        password: <%= ENV['DB_PWD'] %>
    

提交回复
热议问题