SemiFixed: Missing `secret_key_base` for 'production' environment

后端 未结 3 1927
無奈伤痛
無奈伤痛 2021-01-05 02:18

I\'ve created a rails app (Rails 4.1.0) from scratch and I am getting a problem that I am not able to solve. I have installed and configured Apache Passenger Module, it work

3条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-05 02:35

    What I did : On my production server, I create a config file (confthin.yml) for Thin (I'm using it) and add the following information :

    environment: production user: www-data group: www-data SECRET_KEY_BASE: mysecretkeyproduction

    I then launch the app with

    thin start -C /whereeveristhefieonprod/configthin.yml

    Work like a charm and then no need to have the secret key on version control

    Hope it could help, but I'm sure the same thing could be done with Unicorn and others.

提交回复
热议问题