fix error

This commit is contained in:
邱博亞 2021-11-18 09:33:12 +08:00
parent 5042f7cd43
commit e5ae451eb7
1 changed files with 1 additions and 1 deletions

View File

@ -163,7 +163,7 @@ if bundle_update_flag
r = open("#{env_pwd}/config/environment.rb",'r'){|f| f.read()} r = open("#{env_pwd}/config/environment.rb",'r'){|f| f.read()}
secret_key = r.scan(/Orbit::Application\.config\.secret_key_base = '(.*)'/).flatten[0] rescue nil secret_key = r.scan(/Orbit::Application\.config\.secret_key_base = '(.*)'/).flatten[0] rescue nil
if !secret_key.nil? if !secret_key.nil?
open("#{env_pwd}/config/secrets.yml",'r+') do |f| open("#{env_pwd}/config/secrets.yml",'w+') do |f|
c = {"production"=> {"secret_key_base"=> secret_key},"development"=> {"secret_key_base"=> secret_key}}.to_yaml.sub("---\n",'') c = {"production"=> {"secret_key_base"=> secret_key},"development"=> {"secret_key_base"=> secret_key}}.to_yaml.sub("---\n",'')
f.write(c) f.write(c)
end end