Alexander Shmatko Alexander Shmatko - 5 months ago 45
Ruby Question

Missing `secret_token` and `secret_key_base` for 'development' environment, set these values in `config/secrets.yml`

When I try to run

rails server
command I get the error

enter image description here

How to solve it?

My config/environments/development.rb

Rails.application.configure do

config.secret_key_base = ENV["SECRET_KEY_BASE"]

#Some stuff


And I don't have the secret.yml file in my folder.

enter image description here


Then create one:


# be sure to restart your server when you modify this file...
# Make sure the secret is at least 30 characters and all random,
# no regular words or you'll be exposed to dictionary attacks.
  secret_key_base:  asdflkjasdlfkjasldfkj

  secret_key_base:  asdflkhasldfhlhaskdlflakhsdf

  secret_key_base: 523lk5h2lkjlj6nlk4n6lk4

obviously don't use those keys above ^ just mash on your keyboard, or use rake secret to generate one :)