By resting
I’m getting the error
App 2280 stderr: [ 2014-08-04 18:45:00.6935 2301/0x9a59598(Worker 1) utils.rb:72 ]: *** Exception RuntimeError in Rack application object (Missing secret_key_base for 'production' environment, set this value in config/secrets.yml) (process 2301, thread 0x9a59598(Worker 1)):
But I’m sure I’d run export SECRET_KEY_BASE=xxx and ruby -e 'p ENV["SECRET_KEY_BASE"]'. Have went through a page of Google search results. Not sure what else I’m missing.
Setup is as per title.
Side question. Is there anyway we can find back questions we’d asked? I found a solution to my pass problem but I have no idea how to get the question back.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Try adding it to config/secrets.yml:
production:
secret_key_base: XXX
Is there anyway we can find back questions we’d asked? I found a solution to my pass problem but I have no idea how to get the question back.
That’s not supported at the moment, however, it should be soon :) You can search for it until then (using the search bar at the very top of this page).
Make sure you are in development /testing.
Put this in virtual host configuration:
RailsEnv development
Worry about Secrets once you go production mode
Rails default /config/secrets.yml looks like this:
development:
secret_key_base: # random string
test:
secret_key_base: # random string
production:
secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
It is OK to keep test and development secret key base in your (possibly public) codebase, however, the secret key on production should be set up within server environment.
We are running Ubuntu 14.04, here is how we set up our SECRET_KEY_BASE environmental variable:
ssh into your production server and run sudo nano /etc/environment. This will open the environment file in nano text editor. You need to add two lines at the bottom of this file:
export SECRET_KEY_BASE=<rake secret>
ruby -e 'p ENV["SECRET_KEY_BASE"]'
Where <rake secret> is the output you get when running rake secret in console (it will be a string of random characters just like # random string for development and test secret_key_base).
Source /etc/environment or restart the server and test by running echo $SECRET_KEY_BASE.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.