What you can't do
After successfully deploying my own application on Render.com, I tried to proceed with the development locally, but now I can't access DB.
Error Contents
I was going to test with Rspec, but I got an error, so I tried rails db:reset.Then, similarly, the following error occurred:
rails aborted!
ActiveRecord:: ConnectionNotEstablished: could not translate host name "xxxxxxxxxx" to address: Name or service not known
What do you want to do
I would like to resolve this error and continue to develop it locally.
Concerns
I searched the error statement and found an article that seemed to be a solution, but I'm worried that it might affect the person who deployed it.If anyone knows, please advise.
Have you changed database.yml?
I think render.com puts connection information in the DATABASE_URL environment variable, so if that's the case, I think it's common to use different settings in the same file as the local one.
default:&default
adapter —postgresql
encoding:unicode
pool:<%=ENV.fetch("RAILS_MAX_THREADS"){5}%>
host:<%=ENV.fetch("DB_HOST"){"localhost"}%>
port:<%=ENV.fetch("DB_PORT"){532}%>
username:<%=ENV.fetch("DB_USERNAME"){"postgres"}%>
password:<%=ENV.fetch("DB_PASSWORD"){"password"}%>
development:
<<:* default
database:myapp_development
test:
<<:* default
database —myapp_test
production:
adapter —postgresql
encoding:unicode
pool:<%=ENV.fetch("RAILS_MAX_THREADS"){5}%>
url:<%=ENV.fetch("DATABASE_URL"){"}%>
I don't know what's going on, so I can't help it any more
574 rails db:create error: Could not find mysql2-0.5.4 in any of the sources
618 GDB gets version error when attempting to debug with the Presense SDK (IDE)
925 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
577 Who developed the "avformat-59.dll" that comes with FFmpeg?
© 2024 OneMinuteCode. All rights reserved.