Alexander Shmatko Alexander Shmatko - 1 year ago 207
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

Answer Source

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 :)

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download