-
Notifications
You must be signed in to change notification settings - Fork 28
Not so much as a question: secret token #36
Comments
I'm not sure about Engine Yard, but I was having trouble with pushing to heroku and found a solution: errbit/errbit#381 |
Secret tokens are used by many web frameworks (including RoR, to my knowledge) for signing cookies (HMAC, I think) to prevent users from tampering with the data in them. Without looking in to it directly (I'm not familiar with Engine Yard either), I think you should be able to solve your problem by running If setting $SECRET_TOKEN in your environment is an option, that should work, too. Secret Tokens can't be included in the repository because then they aren't secret anymore; unfortunately, this is one of those things that you have to perform at install time instead. |
@frank0051 Whenever you have sensitive information in your app, such as API keys, passwords, or secret tokens, it's recommended to store them in an environment variable. So, instead of having the actual secret token in the source code, you would replace it with For your app to know what the value of the environment variable is, you have to set it in your working environment. When you're using the app on your local machine, the easiest way to set environment variables is to use the figaro gem. It creates a local
For example, to set an env var for the secret token, generate a new random one:
Then set it:
where To check the value of the
Before deploying an app to a hosting service like Heroku or Engine Yard, you have to set the environment variable on the production server first. On Heroku, you do it like this from the command line:
I'm not familiar with Engine Yard, so I don't know the exact command, but I'm sure there's a similar command you can run. Just search for "how to set an environment variable on Engine Yard" or something like that. I hope this helps. |
So, I'm pretty new to Ruby on Rails and I've been attempting to get a demo of this up and running on Engine Yard. I forked the project, connected to it, have the app and DB instance running, but the deploy of HEAD keeps failing. The log says:
rake aborted!
SECRET_TOKEN environment variable must be set!
In various spots. So:
Appreciate any thoughts as to how to get this up and running so I can play around with it.
The text was updated successfully, but these errors were encountered: