Click here to Skip to main content
15,889,838 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
My ruby ​​version is 2.6.6, my mysql version is 8.0.23, my mysql2 version is 0.5.3, my bundler version is 2.2.21, my rails version is 5.0.7.2, and my Xcode version is 12.5.

I use macOS Big Sur(version 11.4) and the text editor "Atom".

I'm planning to release my Rails application with the URL of HEROKU(example. https://[My APP Name].herokuapp.com).

I ran the following command.
Terminal
$ heroku open


The following error occured in my browser.
An unhandled lowlevel error occurred. The application logs may have details.


I set two environment variables as below with this command: "$ heroku config:set [ENVIRONMENT VARIABLE NAME]".
Terminal
$ heroku config:set DATABASE_USERNAME=****
Terminal
$ heroku config:set DATABASE_PASSWORD=****


I ran the following command.
Terminal
$ heroku config

DATABASE_PASSWORD: ****
DATABASE_URL: postgres://****
DATABASE_USERNAME: ****
HEROKU_POSTGRESQL_AQUA_URL: postgres://****
HEROKU_POSTGRESQL_BLACK_URL: postgres://****
LANG: en_US.UTF-8
RACK_ENV: production
RAILS_ENV: production
RAILS_LOG_TO_STDOUT: enabled
RAILS_SERVE_STATIC_FILES: enabled


I ran the following command to get "GENERATED_CODE".
Terminal
$ RAILS_ENV=production rake secret

GENERATED_CODE


I ran the following command.
Terminal
$ vi /etc/profile


I set the environment variable "SECRET_KEY_BASE" as below in Vim editor.
Terminal
# System-wide .profile for sh(1)

if [ -x /usr/libexec/path_helper ]; then
        eval `/usr/libexec/path_helper -s`
fi

if [ "${BASH-no}" != "no" ]; then
        [ -r /etc/bashrc ] && . /etc/bashrc
fi

$ export SECRET_KEY_BASE=GENERATED_CODE


I saved the above "SECRET_KEY_BASE" and ended Vim editor with the two below commands.
Terminal
:w !sudo tee %
Terminal
:q!


I opened the vim editor again as below with this command:$ vi /etc/profile.
Terminal
# System-wide .profile for sh(1)

if [ -x /usr/libexec/path_helper ]; then
        eval `/usr/libexec/path_helper -s`
fi

if [ "${BASH-no}" != "no" ]; then
        [ -r /etc/bashrc ] && . /etc/bashrc
fi

$ export SECRET_KEY_BASE=GENERATED_CODE

"/etc/profile" [readonly] 13L, 346B


I ran the two following command for verifying that the environment variable "SECRET_KEY_BASE" is properly set in Linux.
Terminal
$ printenv | grep SECRET_KEY_BASE
Terminal
$ echo $SECRET_KEY_BASE


But I can't verify that the environment variable "SECRET_KEY_BASE" is properly set in Linux with this command:
Terminal
$ printenv | grep SECRET_KEY_BASE
or with:
Terminal
$ echo $SECRET_KEY_BASE


Would you like to tell me the reason why I can't verify that the environment variable "SECRET_KEY_BASE" is properly set in Linux with the two following command?
Terminal
$ printenv | grep SECRET_KEY_BASE`
Terminal
$ echo $SECRET_KEY_BASE


What I have tried:

I wrote in this question sentence what I tried.
Posted
Updated 27-Jul-21 4:16am
v2

1 solution

$ export SECRET_KEY_BASE=GENERATED_CODE

What is the $ sign in column 1 supposed to be for?
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900