运行项目Internal server error报错

2020-01-19  本文已影响0人  落叶05

https://teamtreehouse.com/community/project-files-lead-to-missing-secretkeybase-for-development-environment-set-this-value-in-configsecretsyml

In case anyone else was wondering, the following solution helped me:

Create a secrets.yml file in your config directory.

In your terminal, type the following command: rake secret. This will generate a secret for you to include in your secrets.yml file.

Add the following snippet of code to your config/secrets.yml file:

development:
  secret_key_base: PASTE_YOUR_GENERATED_SECRET_HERE
(NOTE: WHEN TYPING THE ABOVE COMMAND, BE SURE TO ADD SPACES BEFORE "secret_key_base" AND NOT TABS, AS THIS WON'T WORK IN A YML FILE.)

Be sure to migrate your database: bin/rake db:migrate RAILS_ENV=development

Now when you boot up the server and render the application in the browser, you should be good to go.

上一篇 下一篇

猜你喜欢

热点阅读