Hello everyone,
I've been trying to install forem on Docker on Ubuntu 18.04 but I cannot success. I've tried to install it on Heroku, fail again. I've fullfilled Fastly, HoneyBadger, Amazon AWS and Cloudinary API settings on .env file and use the file in docker-compose.yml file via the setting below:
env_file:
- .env
I can install it on Development but in this time the chunk .js files cannot be loaded. They throw 404 errors.
When I'm trying to install on Production environment it throw "SECRET_KEY_BASE" error when rails loading. I've been tried a lot of methods to solve these errors, but each time I've gotten different errors.
Finally, @manuel and @akhil I've read your comments and tutorials but the errors persist.
Can you share your .env, docker-compose.yml, Containerfile files with hiding your secret values with me, please. I'm so tired :(
Have a good day.
Top comments (9)
Hey, in Heroku the most important part is to add necessary plugins, build packs and ENV variables. I will list those names here.
Plugins/add-ons:
Build packs(order is important):
ENV(must configure variables):
Few points to remember
Following all these will give you a working Forem in Heroku but if you are using free plan, it will crash in a minute or two. At least I you can reach till hear think of getting standard tier of Heroku.
I've done what you said but there is no change. On Heroku, I've assigned all .env variables and Buildpacks in correct order, it shows me the error message below:
NoMethodError: undefined method `protocol' for nil:NilClass
def self.local_image(image_name, host: nil)
host ||= ActionController::Base.asset_host || url(nil)
ActionController::Base.helpers.image_url(image_name, host: host)
end
I've forked forem on github and used GitHub connection as a deployment method. Then, I deployed it manually by using the "Manuel Deploy" section on Heroku.
I've also add Tier-1 dynos, Standard-0 Postgresqland Premium-0 Redis Add-ons.
What do I do wrong?
Did you added honeybadger api keys? And https?
Ofcourse. I've added an image below. You can see all filled variables.
forem.dev/remoteimages/uploads/art...
If you have a few minutes and share your main e-mail address here, I can add you as an owner on Heroku. If you can help, I will be so grateful.
Did you updated the Forem to the latest version. If not first update it.
Whatever is the case, from the ENV screenshot you have sent I was not able to see one of the critical environmental variable for any Production, i.e., SECRET_KEY_BASE.
How can I create a SECRET_KEY_BASE on Heroku. I think it is created by the command "rake credentials:edit". There is a way to do that on Heroku?
You can get SECRET_KEY_BASE value, by executing the command
rake secret
within the Heroku machine (in Heroku terminal). Usually there are two ways to do it.You can install Heroku cli within your local PC and can directly access Heroku bash from your local terminal. (But if you are beginner, I suggest you to check the second option)
If you are only familiar with Heroku through GUI, this is best suited for them. With in you app settings, at the top right corner you can see an option "More". Upon clicking on more you can now see a menu list which contains an option to access terminal, i.e., "run console". Clicking on run console will pop up a window to run Heroku commands. Within this type the command "bash" and press on "run", this will give access to Heroku bash/terminal.
Once you have access to Heroku Terminal, just run the command,
rake secret
. This will result in providing you with a randomly generated string. Now you can use this randomly generated string as the value to your SECRET_KEY_BASE environmental variable.Thank you for your reply Akhil, should I add the env variables on Heroku Config Vars section or just .env file?
In Heroku