Thursday, October 16, 2014

set environment variable

Insert these lines of code to the config/application.rb after lineconfig.assets.version = '1.0':

config.before_configuration do
      env_file = File.join(Rails.root, 'config', 'paypal.yml')
      YAML.load(File.open(env_file)).each do |key, value|
        ENV[key.to_s] = value
      end if File.exists?(env_file)
    end

No comments:

Post a Comment