I am trying to go to my localhost and I keep getting the following error in my browser:
You must set config.secret_key_base in your app's config
I have looked around and people say that you have to rake the secret key and then put it into config/initializers/secret_token.rb
but I don't have a secret_token.rb
file in my folder. I am running ruby version ruby 2.1.2p9
and rails version Rails 4.0.8 I am following the tutorial at railstutorial.org
if that helps on 2.2
Run rake secret
to generate a new token.
Now create a new file config/initializers/secret_token.rb
and add the following:
MyApp::Application.config.secret_key_base = '<token>'
Replace <token>
with the one you just generated and replace MyApp
with the actual module name of your app. You can find the module name of your app at the top of config/environments/development.rb
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With