0

When I am trying to run my web application I am getting below error on the browser:

You must set config.secret_key_base in your app's config. 

I don't understand why it comes, and I don't have secret_token.rb at config/initializers/secret_token.rb. How do I resolve it. Kindly suggest me, waiting for reply. Thanks.

user88
  • 1,174
  • 3
  • 27
  • 51

1 Answers1

0

This is because you have added the secret token file in the git ignore file. Remove the config/initializers/secret_token.rb from .gitignore file.

This can help you

Community
  • 1
  • 1
Animesh
  • 1,005
  • 10
  • 20
  • and where is .gitignore file on the system. – user88 Jun 16 '14 at 11:00
  • go to the directory where your project is stored and press Ctrl + h...This will list all the hidden files. gitignore is a hidden file – Animesh Jun 16 '14 at 11:21
  • I have pushed my application on the github and check .gitignore txt file but there is no this type of statement `config/initializers/secret_token.rb` on the .gitignore txt file. how can I resolve this issue. – user88 Jun 16 '14 at 12:15
  • Check the link provided in the answer – Animesh Jun 16 '14 at 12:42
  • after running this command `rake secret` on rails command line, `secret_token.rb` is created on the project? – user88 Jun 16 '14 at 12:56
  • I have already check that link but I don't have `secret_token.rb` file on the project? where I can update token generated from the command `rake secret`. – user88 Jun 16 '14 at 13:10
  • create a secret token.rb file and inside it add this line "Projectname::Application.config.secret_token = ' put your secret token generated by rake secret command here'"....And you are ready to go. – Animesh Jun 17 '14 at 10:18