I don't know if Cloudinary or database settings are wrong.

Asked 1 years ago, Updated 1 years ago, 345 views

I asked the following questions and was able to set them up.
When I tried to post an image in the production environment, an error occurred.

The Cloudinary configuration I was referring to should have been done, but an error occurred.
I also created the render database and set the environment variables in render, but it didn't work.
Which one should I keep an eye on at times like this?
I am also attaching a git with the error log when posting.
https://gist.githubusercontent.com/2J445/dbf44b94834975fa4c0b13ea032c3796/raw/a376d2ded17a728c79d5954c7963b821a164e519/gistfile1.txt

The DATABASE_URL has been substituted for the internal database URL of the database created in render, is that correct?
Enter a description of the image here

Below is the code for the database settings.
***** is related to the database that I set up. Do I have to make the name: part of fromDatabase: the name: part of databases: the same as the name: part of databases:?

databases:
  - name —************
    databaseName:*********
    user:*********
    region —singapore


services:
  - type —web
    name —************
    env:ruby
    region —singapore
    buildCommand: "./bin/render-build.sh"
    startCommand: "bundle exec puma-C config /puma.rb"
    envVars:
      - key:<%=ENV['DATABASE_URL']%>
        fromDatabase:
          name —Render_app
          property:connectionString
      - key:<%=ENV['RAILS_MASTER_KEY']%>
        sync:false

About Cloudinary Deployment

ruby-on-rails ruby postgresql database

2023-02-27 21:44

1 Answers

I think it's render.yaml, but this file is not interpreted by Rails and cannot embed ERB (<%=%>) and it doesn't work.

https://render.com/docs/deploy-rails#use-renderyaml-to-deploy
It looks like I'm rewriting it from the documentation…

***** is related to the database that I set up. Do I have to make the name: part of fromDatabase: the name: part of databases: the same as the name: part of databases:?

That's right!

The DATABASE_URL has been substituted for the internal database URL of the database created in render, is that correct?

It's wrong.
I think it will be as follows.The setting means

  • To the environment variable DATABASE_URL
  • Database service with specified name
  • Set the value of the connectionString property (Properties List)

That's it.

 envVars:
      - key —DATABASE_URL
        fromDatabase:
          name —Name of the databases configured in name:
          property:connectionString

Also, RAILS_MASTER_KEY does not need <%=%>

-key:RAILS_MASTER_KEY
        sync:false

I think it's probably a mess because I don't understand exactly why the YAML in the previous cloudinary setting didn't work or why the change caused it to move.


2023-02-27 22:15

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.